rename a function to indicate that it checks for profitability as well
[oota-llvm.git] / lib / Transforms / Scalar / LoopDeletion.cpp
index 3c0e8662a25583bf4dc5553b5657b30b40ff210e..86edcfaac80db122d3a914ffc5754d7c4dff475b 100644 (file)
@@ -30,7 +30,7 @@ namespace {
   class VISIBILITY_HIDDEN LoopDeletion : public LoopPass {
   public:
     static char ID; // Pass ID, replacement for typeid
-    LoopDeletion() : LoopPass((intptr_t)&ID) { }
+    LoopDeletion() : LoopPass(&ID) {}
     
     // Possibly eliminate loop L if it is dead.
     bool runOnLoop(Loop* L, LPPassManager& LPM);
@@ -60,7 +60,7 @@ namespace {
 char LoopDeletion::ID = 0;
 static RegisterPass<LoopDeletion> X("loop-deletion", "Delete dead loops");
 
-LoopPass* llvm::createLoopDeletionPass() {
+Pass* llvm::createLoopDeletionPass() {
   return new LoopDeletion();
 }
 
@@ -209,7 +209,7 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
     for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
          BI != BE; ) {
       Instruction* I = BI++;
-      if (I->getNumUses() > 0 && IsLoopInvariantInst(I, L))
+      if (!I->use_empty() && IsLoopInvariantInst(I, L))
         I->moveBefore(preheader->getTerminator());
     }