diff options
Diffstat (limited to 'lib/Transforms/NaCl/LowerEmExceptionsPass.cpp')
-rw-r--r-- | lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | 9 |
1 files changed, 9 insertions, 0 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()); |