diff options
Diffstat (limited to 'lib/Transforms/NaCl/LowerEmExceptionsPass.cpp')
-rw-r--r-- | lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp index 2c0b294280..1cb246563b 100644 --- a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp +++ b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp @@ -99,10 +99,14 @@ bool LowerEmExceptions::runOnModule(Module &M) { } FunctionType *VoidFunc = FunctionType::get(Void, false); - PreInvoke = Function::Create(VoidFunc, GlobalValue::ExternalLinkage, "emscripten_preinvoke", TheModule); + if (!TheModule->getFunction("emscripten_preinvoke")) { + PreInvoke = Function::Create(VoidFunc, GlobalValue::ExternalLinkage, "emscripten_preinvoke", TheModule); + } FunctionType *Int1Func = FunctionType::get(i1, false); - PostInvoke = Function::Create(Int1Func, GlobalValue::ExternalLinkage, "emscripten_postinvoke", TheModule); + if (!TheModule->getFunction("emscripten_postinvoke")) { + PostInvoke = Function::Create(Int1Func, GlobalValue::ExternalLinkage, "emscripten_postinvoke", TheModule); + } FunctionType *LandingPadFunc = FunctionType::get(i8P, true); LandingPad = Function::Create(LandingPadFunc, GlobalValue::ExternalLinkage, "emscripten_landingpad", TheModule); |