aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-10 14:42:32 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-10 14:42:32 -0800
commit2ea97cf26f95547335998d8e5a8b4d6a7738cb41 (patch)
treee61197bc71edb308ff328a57429e50465218dbc2
parent28ff124c6e275da72d2550576f5c3282d0521d60 (diff)
type corrections in LowerEmExceptionsPass
-rw-r--r--lib/Transforms/NaCl/LowerEmExceptionsPass.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp
index 18afc46c68..90331eb9e5 100644
--- a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp
+++ b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp
@@ -102,7 +102,7 @@ bool LowerEmExceptions::runOnModule(Module &M) {
FunctionType *Int1Func = FunctionType::get(i1, false);
PostInvoke = Function::Create(Int1Func, GlobalValue::ExternalLinkage, "emscripten_postinvoke", TheModule);
- FunctionType *LandingPadFunc = FunctionType::get(i32, true);
+ FunctionType *LandingPadFunc = FunctionType::get(i8P, true);
LandingPad = Function::Create(LandingPadFunc, GlobalValue::ExternalLinkage, "emscripten_landingpad", TheModule);
// Process
@@ -145,12 +145,8 @@ bool LowerEmExceptions::runOnModule(Module &M) {
Instruction *High = CallInst::Create(GetHigh, "", LP);
// New recreate an aggregate for them, which will be all simplified later (simplification cannot handle landingpad, hence all this)
- SmallVector<unsigned, 1> IVArgsA;
- IVArgsA.push_back(0);
- InsertValueInst *IVA = InsertValueInst::Create(UndefValue::get(LP->getType()), NewLP, IVArgsA, "", LP);
- SmallVector<unsigned, 1> IVArgsB;
- IVArgsB.push_back(1);
- InsertValueInst *IVB = InsertValueInst::Create(IVA, High, IVArgsB, "", LP);
+ InsertValueInst *IVA = InsertValueInst::Create(UndefValue::get(LP->getType()), NewLP, 0, "", LP);
+ InsertValueInst *IVB = InsertValueInst::Create(IVA, High, 1, "", LP);
LP->replaceAllUsesWith(IVB);
ToErase.push_back(LP);