If an alias is dead and so is its aliasee, then globaldce would
[oota-llvm.git] / lib / Transforms / Scalar / ConstantProp.cpp
index 90e8dad4f8af0605bf1831d4e52695a555e2c699..b933488cf636f315603493b838bd0c41fce5da8f 100644 (file)
@@ -14,7 +14,7 @@
 //
 // Notice that:
 //   * This pass has a habit of making definitions be dead.  It is a good idea
-//     to to run a DIE pass sometime after running this pass.
+//     to run a DIE pass sometime after running this pass.
 //
 //===----------------------------------------------------------------------===//
 
@@ -35,7 +35,7 @@ STATISTIC(NumInstKilled, "Number of instructions killed");
 namespace {
   struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
-    ConstantPropagation() : FunctionPass((intptr_t)&ID) {}
+    ConstantPropagation() : FunctionPass(&ID) {}
 
     bool runOnFunction(Function &F);
 
@@ -79,7 +79,7 @@ bool ConstantPropagation::runOnFunction(Function &F) {
 
         // Remove the dead instruction.
         WorkList.erase(I);
-        I->getParent()->getInstList().erase(I);
+        I->eraseFromParent();
 
         // We made a change to the function...
         Changed = true;