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

Commit 8676838

Browse files
zhuoweiMaxDesiatov
authored andcommitted
WebAssembly: default to disabling exceptions on WebAssembly
1 parent bfaa96e commit 8676838

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
@@ -448,6 +448,9 @@ static void addExceptionArgs(const ArgList &Args, types::ID InputType,
448448
// Disable C++ EH by default on XCore and PS4.
449449
bool CXXExceptionsEnabled =
450450
Triple.getArch() != llvm::Triple::xcore && !Triple.isPS4CPU();
451+
// WebAssembly: no exception handling on WASI
452+
if (Triple.isOSBinFormatWasm())
453+
CXXExceptionsEnabled = false;
451454
Arg *ExceptionArg = Args.getLastArg(
452455
options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions,
453456
options::OPT_fexceptions, options::OPT_fno_exceptions);

0 commit comments

Comments
 (0)