PreferredEHDataFormat is always call with data and global, but this whole
[oota-llvm.git] / lib / CodeGen / DwarfEHPrepare.cpp
index 5fa8dcea3467992f9563e54bb9cb12328a2e464f..5bfb32870c9801ebf816544c9779cca9039675bc 100644 (file)
@@ -314,7 +314,7 @@ bool DwarfEHPrepare::PromoteStackTemporaries() {
   if (ExceptionValueVar && DT && DF && isAllocaPromotable(ExceptionValueVar)) {
     // Turn the exception temporary into registers and phi nodes if possible.
     std::vector<AllocaInst*> Allocas(1, ExceptionValueVar);
-    PromoteMemToReg(Allocas, *DT, *DF, Context);
+    PromoteMemToReg(Allocas, *DT, *DF, ExceptionValueVar->getContext());
     return true;
   }
   return false;
@@ -354,8 +354,7 @@ Instruction *DwarfEHPrepare::CreateValueLoad(BasicBlock *BB) {
 
   // Create the temporary if we didn't already.
   if (!ExceptionValueVar) {
-    ExceptionValueVar = new AllocaInst(*Context, 
-                                       PointerType::getUnqual(Type::Int8Ty),
+    ExceptionValueVar = new AllocaInst(PointerType::getUnqual(Type::Int8Ty),
                                        "eh.value", F->begin()->begin());
     ++NumStackTempsIntroduced;
   }