diff options
-rw-r--r-- | lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | 9 | ||||
-rw-r--r-- | lib/Transforms/NaCl/PNaClABISimplify.cpp | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp index 1cb246563b..1669603de7 100644 --- a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp +++ b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp @@ -84,6 +84,15 @@ INITIALIZE_PASS(LowerEmExceptions, "loweremexceptions", bool LowerEmExceptions::runOnModule(Module &M) { TheModule = &M; + // Checks + + Function *Setjmp = TheModule->getFunction("setjmp"); + if (Setjmp) { + for (Instruction::use_iterator UI = Setjmp->use_begin(), UE = Setjmp->use_end(); UI != UE; ++UI) { + assert(0 && "emscripten fastcomp does not support c++ exceptions and setjmp/longjmp together yet. disable exceptions (-s DISABLE_EXCEPTION_CATCHING=1) or remove setjmp from your code, for now, or use the original emscripten compiler instead of fastcomp."); + } + } + // Add functions Type *i32 = Type::getInt32Ty(M.getContext()); diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 356c21e6e5..3b08d97425 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -47,9 +47,9 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) { PM.add(createLowerInvokePass()); // Remove landingpad blocks made unreachable by LowerInvoke. PM.add(createCFGSimplificationPass()); - } - //PM.add(createLowerEmSetjmpPass()); // XXX EMSCRIPTEN + //PM.add(createLowerEmSetjmpPass()); // XXX EMSCRIPTEN . Note, only if no exceptions + } #if 0 // EMSCRIPTEN: we allow arbitrary symbols to be preserved // Internalize all symbols in the module except _start, which is the only |