If an alias is dead and so is its aliasee, then globaldce would
[oota-llvm.git] / lib / Transforms / Scalar / Reg2Mem.cpp
index b31b1d1fa6ea8b194d7be23ac1943af1a0c9e987..46b2952b4cc5ef2ed728ce23cd21aae5338c3cf6 100644 (file)
@@ -36,7 +36,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,7 +67,7 @@ namespace {
         while (isa<AllocaInst>(I)) ++I;
 
         CastInst *AllocaInsertionPoint =
-          CastInst::create(Instruction::BitCast,
+          CastInst::Create(Instruction::BitCast,
                            Constant::getNullValue(Type::Int32Ty), Type::Int32Ty,
                            "reg2mem alloca point", I);
 
@@ -119,7 +119,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();
 }