From 06b7ce14ded3d39a8e4703d22b360fa782c1522a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 7 Mar 2014 17:35:43 -0800 Subject: fix the case where exceptions are lowered and we already had getHigh/preInvoke/postInvoke defined in the module --- lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp index ac07530ab8..3f6f18274f 100644 --- a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp +++ b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp @@ -99,19 +99,19 @@ bool LowerEmExceptions::runOnModule(Module &M) { Type *i8P = i8->getPointerTo(); Type *Void = Type::getVoidTy(M.getContext()); - if (!TheModule->getFunction("getHigh32")) { + if (!(GetHigh = TheModule->getFunction("getHigh32"))) { FunctionType *GetHighFunc = FunctionType::get(i32, false); GetHigh = Function::Create(GetHighFunc, GlobalValue::ExternalLinkage, "getHigh32", TheModule); } - FunctionType *VoidFunc = FunctionType::get(Void, false); - if (!TheModule->getFunction("emscripten_preinvoke")) { + if (!(PreInvoke = TheModule->getFunction("emscripten_preinvoke"))) { + FunctionType *VoidFunc = FunctionType::get(Void, false); PreInvoke = Function::Create(VoidFunc, GlobalValue::ExternalLinkage, "emscripten_preinvoke", TheModule); } - FunctionType *IntFunc = FunctionType::get(i32, false); - if (!TheModule->getFunction("emscripten_postinvoke")) { + if (!(PostInvoke = TheModule->getFunction("emscripten_postinvoke"))) { + FunctionType *IntFunc = FunctionType::get(i32, false); PostInvoke = Function::Create(IntFunc, GlobalValue::ExternalLinkage, "emscripten_postinvoke", TheModule); } -- cgit v1.2.3-18-g5258