s/DebugInfoEnumerator/DebugInfoFinder/g
[oota-llvm.git] / lib / Transforms / Scalar / Reg2Mem.cpp
index b31b1d1fa6ea8b194d7be23ac1943af1a0c9e987..2c1569dbda743fe01b745dfa147482fc07d416c3 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Pass.h"
 #include "llvm/Function.h"
+#include "llvm/LLVMContext.h"
 #include "llvm/Module.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Instructions.h"
@@ -36,7 +37,7 @@ STATISTIC(NumPhisDemoted, "Number of phi-nodes demoted");
 namespace {
   struct VISIBILITY_HIDDEN RegToMem : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    RegToMem() : FunctionPass((intptr_t)&ID) {}
+    RegToMem() : FunctionPass(&ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequiredID(BreakCriticalEdgesID);
@@ -67,8 +68,8 @@ namespace {
         while (isa<AllocaInst>(I)) ++I;
 
         CastInst *AllocaInsertionPoint =
-          CastInst::create(Instruction::BitCast,
-                           Constant::getNullValue(Type::Int32Ty), Type::Int32Ty,
+          CastInst::Create(Instruction::BitCast,
+                      F.getContext().getNullValue(Type::Int32Ty), Type::Int32Ty,
                            "reg2mem alloca point", I);
 
         // Find the escaped instructions. But don't create stack slots for
@@ -119,7 +120,7 @@ X("reg2mem", "Demote all values to stack slots");
 
 // createDemoteRegisterToMemory - Provide an entry point to create this pass.
 //
-const PassInfo *llvm::DemoteRegisterToMemoryID = X.getPassInfo();
+const PassInfo *const llvm::DemoteRegisterToMemoryID = &X;
 FunctionPass *llvm::createDemoteRegisterToMemoryPass() {
   return new RegToMem();
 }