diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-20 09:43:30 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-20 09:43:30 -0800 |
commit | 8f802774d850b5e5c1a48419d0a655471d29018e (patch) | |
tree | 1ae056550c9c92e57eb2718e4d68a161a45baccb /lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | |
parent | 10af3696c0c6cd6e4050d6b4534dfc05c5e0d52f (diff) |
allow only setjmp or c++ exceptions in fastcomp for now
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()); |