* We were forgetting to pass varargs arguments through a call
[oota-llvm.git] / lib / Transforms / Scalar / CorrelatedExprs.cpp
index 9b90155ca82a56a63ea31ef44e5f6fbb96a97482..8e6a2ae5b84fc0f52bf3c57d7d721442237c66cd 100644 (file)
@@ -1,4 +1,11 @@
 //===- CorrelatedExprs.cpp - Pass to detect and eliminated c.e.'s ---------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // Correlated Expression Elimination propagates information from conditional
 // branches to blocks dominated by destinations of the branch.  It propagates
@@ -121,7 +128,7 @@ namespace {
     void setReplacement(Value *Repl) { Replacement = Repl; }
 
     // getRelation - return the relationship entry for the specified value.
-    // This can invalidate references to other Relation's, so use it carefully.
+    // This can invalidate references to other Relations, so use it carefully.
     //
     Relation &getRelation(Value *V) {
       // Binary search for V's entry...
@@ -291,7 +298,7 @@ bool CEE::runOnFunction(Function &F) {
   DT = &getAnalysis<DominatorTree>();
   
   std::set<BasicBlock*> VisitedBlocks;
-  bool Changed = TransformRegion(&F.getEntryNode(), VisitedBlocks);
+  bool Changed = TransformRegion(&F.getEntryBlock(), VisitedBlocks);
 
   RegionInfoMap.clear();
   RankMap.clear();
@@ -338,7 +345,7 @@ bool CEE::TransformRegion(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks){
   DominatorTree::Node *BBN = (*DT)[BB];
   if (!RI.empty())        // Time opt: only propagate if we can change something
     for (unsigned i = 0, e = BBN->getChildren().size(); i != e; ++i) {
-      BasicBlock *Dominated = BBN->getChildren()[i]->getNode();
+      BasicBlock *Dominated = BBN->getChildren()[i]->getBlock();
       assert(RegionInfoMap.find(Dominated) == RegionInfoMap.end() &&
              "RegionInfo should be calculated in dominanace order!");
       getRegionInfo(Dominated) = RI;
@@ -363,7 +370,7 @@ bool CEE::TransformRegion(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks){
 
   // Now that all of our successors have information, recursively process them.
   for (unsigned i = 0, e = BBN->getChildren().size(); i != e; ++i)
-    Changed |= TransformRegion(BBN->getChildren()[i]->getNode(), VisitedBlocks);
+    Changed |= TransformRegion(BBN->getChildren()[i]->getBlock(),VisitedBlocks);
 
   return Changed;
 }
@@ -379,7 +386,7 @@ static bool isBlockSimpleEnough(BasicBlock *BB) {
   // Check the common case first: empty block, or block with just a setcc.
   if (BB->size() == 1 ||
       (BB->size() == 2 && &BB->front() == BI->getCondition() &&
-       BI->getCondition()->use_size() == 1))
+       BI->getCondition()->hasOneUse()))
     return true;
 
   // Check the more complex case now...
@@ -896,7 +903,7 @@ void CEE::PropagateRelation(Instruction::BinaryOps Opcode, Value *Op0,
     return;
   }
 
-  // If the information propogted is new, then we want process the uses of this
+  // If the information propagated is new, then we want process the uses of this
   // instruction to propagate the information down to them.
   //
   if (Op1R.incorporate(Opcode, VI))