Move more code back to 2.5 APIs.
[oota-llvm.git] / lib / Transforms / IPO / LowerSetJmp.cpp
index dfc040b83342405ed444559636a8470d47039b26..3a65ac7a8f596ab6a1c26b705f4b13c0412f89c0 100644 (file)
@@ -39,6 +39,7 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/LLVMContext.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CFG.h"
@@ -380,8 +381,7 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst)
     new BitCastInst(Inst->getOperand(1), SBPTy, "SBJmpBuf", Inst);
   std::vector<Value*> Args = 
     make_vector<Value*>(GetSetJmpMap(Func), BufPtr,
-                        ConstantInt::get(Type::Int32Ty,
-                                         SetJmpIDMap[Func]++), 0);
+                        ConstantInt::get(Type::Int32Ty,SetJmpIDMap[Func]++), 0);
   CallInst::Create(AddSJToMap, Args.begin(), Args.end(), "", Inst);
 
   // We are guaranteed that there are no values live across basic blocks
@@ -427,7 +427,7 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst)
   PHINode* PHI = PHINode::Create(Type::Int32Ty, "SetJmpReturn", Inst);
 
   // Coming from a call to setjmp, the return is 0.
-  PHI->addIncoming(ConstantInt::getNullValue(Type::Int32Ty), ABlock);
+  PHI->addIncoming(Inst->getContext().getNullValue(Type::Int32Ty), ABlock);
 
   // Add the case for this setjmp's number...
   SwitchValuePair SVP = GetSJSwitch(Func, GetRethrowBB(Func));