Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit a99d229

Browse files
committed
WebAssembly: default to disabling exceptions on WebAssembly
1 parent 09e6e53 commit a99d229

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ static void addExceptionArgs(const ArgList &Args, types::ID InputType,
445445
// Disable C++ EH by default on XCore and PS4.
446446
bool CXXExceptionsEnabled =
447447
Triple.getArch() != llvm::Triple::xcore && !Triple.isPS4CPU();
448+
// WebAssembly: no exception handling on WASI
449+
if (Triple.isOSBinFormatWasm())
450+
CXXExceptionsEnabled = false;
448451
Arg *ExceptionArg = Args.getLastArg(
449452
options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions,
450453
options::OPT_fexceptions, options::OPT_fno_exceptions);

0 commit comments

Comments
 (0)