rename use_const_iterator to const_use_iterator for consistency's sake
authorGabor Greif <ggreif@gmail.com>
Thu, 25 Mar 2010 23:06:16 +0000 (23:06 +0000)
committerGabor Greif <ggreif@gmail.com>
Thu, 25 Mar 2010 23:06:16 +0000 (23:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99564 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
include/llvm/Support/CFG.h
include/llvm/Support/CallSite.h
include/llvm/Value.h
lib/Analysis/CaptureTracking.cpp
lib/Analysis/LiveValues.cpp
lib/Analysis/MemoryBuiltins.cpp
lib/Transforms/Scalar/CodeGenPrepare.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/Reg2Mem.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
lib/VMCore/Constants.cpp
lib/VMCore/Function.cpp
lib/VMCore/Globals.cpp
lib/VMCore/Instruction.cpp
lib/VMCore/Value.cpp

index 3875f0b4a0fd57f0760f0c75c950e3d0fe5b39f6..621d50effd46844cff938d7ede67d404959f7a3c 100644 (file)
@@ -67,7 +67,7 @@ public:
 
 typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
 typedef PredIterator<const BasicBlock,
-                     Value::use_const_iterator> pred_const_iterator;
+                     Value::const_use_iterator> pred_const_iterator;
 
 inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
 inline pred_const_iterator pred_begin(const BasicBlock *BB) {
index 9d9a30e6ad2f0305762c65569d111c5ad2125b76..480535fa9e767ae9bc8e85ac5ea2b887d5851468 100644 (file)
@@ -196,7 +196,7 @@ public:
   bool isCallee(Value::use_iterator UI) const {
     return getCallee() == &UI.getUse();
   }
-  bool isCallee(Value::use_const_iterator UI) const {
+  bool isCallee(Value::const_use_iterator UI) const {
     return getCallee() == &UI.getUse();
   }
 private:
index d06cbc05c6a5a7850a1e2d7b2d46d2a2c54f813f..992a90c479c4ce3da2a2553c868efbcdc6b10840 100644 (file)
@@ -157,13 +157,13 @@ public:
   // Methods for handling the chain of uses of this Value.
   //
   typedef value_use_iterator<User>       use_iterator;
-  typedef value_use_iterator<const User> use_const_iterator;
+  typedef value_use_iterator<const User> const_use_iterator;
 
   bool               use_empty() const { return UseList == 0; }
   use_iterator       use_begin()       { return use_iterator(UseList); }
-  use_const_iterator use_begin() const { return use_const_iterator(UseList); }
+  const_use_iterator use_begin() const { return const_use_iterator(UseList); }
   use_iterator       use_end()         { return use_iterator(0);   }
-  use_const_iterator use_end()   const { return use_const_iterator(0);   }
+  const_use_iterator use_end()   const { return const_use_iterator(0);   }
   User              *use_back()        { return *use_begin(); }
   const User        *use_back()  const { return *use_begin(); }
 
@@ -172,7 +172,7 @@ public:
   /// traversing the whole use list.
   ///
   bool hasOneUse() const {
-    use_const_iterator I = use_begin(), E = use_end();
+    const_use_iterator I = use_begin(), E = use_end();
     if (I == E) return false;
     return ++I == E;
   }
index 8767c1814172fbcd30755070f673ee487284791d..047825884ef357af0d2791fe18722e3a91d0500b 100644 (file)
@@ -49,7 +49,7 @@ bool llvm::PointerMayBeCaptured(const Value *V,
   SmallSet<Use*, Threshold> Visited;
   int Count = 0;
 
-  for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();
+  for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
        UI != UE; ++UI) {
     // If there are lots of uses, conservatively say that the value
     // is captured to avoid taking too much compile time.
index 1b91d93c0e1ffda0db72136dde5e1efd1ba42cd5..23964ffc457ed5cd305efb61de02bec1f0c06862 100644 (file)
@@ -125,7 +125,7 @@ LiveValues::Memo &LiveValues::compute(const Value *V) {
   bool LiveOutOfDefBB = false;
 
   // Examine each use of the value.
-  for (Value::use_const_iterator I = V->use_begin(), E = V->use_end();
+  for (Value::const_use_iterator I = V->use_begin(), E = V->use_end();
        I != E; ++I) {
     const User *U = *I;
     const BasicBlock *UseBB = cast<Instruction>(U)->getParent();
index 297b5880c4186d66d6f985c5d13ccbd125f2136b..89f9743daa540e8d31f16c6433f75ef7b38b90bb 100644 (file)
@@ -139,7 +139,7 @@ const PointerType *llvm::getMallocType(const CallInst *CI) {
   unsigned NumOfBitCastUses = 0;
 
   // Determine if CallInst has a bitcast use.
-  for (Value::use_const_iterator UI = CI->use_begin(), E = CI->use_end();
+  for (Value::const_use_iterator UI = CI->use_begin(), E = CI->use_end();
        UI != E; )
     if (const BitCastInst *BCI = dyn_cast<BitCastInst>(*UI++)) {
       MallocType = cast<PointerType>(BCI->getDestTy());
index 50c96304db095c93e28aaab901e3b686a3072a2c..6dd02d28729e9c278eb6330cd84569de2e712402 100644 (file)
@@ -174,7 +174,7 @@ bool CodeGenPrepare::CanMergeBlocks(const BasicBlock *BB,
   // don't mess around with them.
   BasicBlock::const_iterator BBI = BB->begin();
   while (const PHINode *PN = dyn_cast<PHINode>(BBI++)) {
-    for (Value::use_const_iterator UI = PN->use_begin(), E = PN->use_end();
+    for (Value::const_use_iterator UI = PN->use_begin(), E = PN->use_end();
          UI != E; ++UI) {
       const Instruction *User = cast<Instruction>(*UI);
       if (User->getParent() != DestBB || !isa<PHINode>(User))
index f920dcab25dfade2ca58025cce4aa4e68a16db72..b7622ab4d6d96417b318a5e7b36e1dcffa9f2fbd 100644 (file)
@@ -1899,7 +1899,7 @@ LSRInstance::CollectLoopInvariantFixupsAndFormulae() {
       const Value *V = U->getValue();
       if (const Instruction *Inst = dyn_cast<Instruction>(V))
         if (L->contains(Inst)) continue;
-      for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();
+      for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
            UI != UE; ++UI) {
         const Instruction *UserInst = dyn_cast<Instruction>(*UI);
         // Ignore non-instructions.
index 99e12522ce0c7625c4750bf468b09b53be0860fe..7a6eec3d46b4513ee857f2982e61013fbf867857 100644 (file)
@@ -45,7 +45,7 @@ namespace {
 
    bool valueEscapes(const Instruction *Inst) const {
      const BasicBlock *BB = Inst->getParent();
-      for (Value::use_const_iterator UI = Inst->use_begin(),E = Inst->use_end();
+      for (Value::const_use_iterator UI = Inst->use_begin(),E = Inst->use_end();
            UI != E; ++UI)
         if (cast<Instruction>(*UI)->getParent() != BB ||
             isa<PHINode>(*UI))
index aa63ca72ccb572aa126dd31bd98c7cc9d0cf85fe..b15df2acaa7dd8d55a25c3793e9166aa029e90cc 100644 (file)
@@ -1709,7 +1709,7 @@ static bool AddressIsTaken(const GlobalValue *GV) {
   // Delete any dead constantexpr klingons.
   GV->removeDeadConstantUsers();
 
-  for (Value::use_const_iterator UI = GV->use_begin(), E = GV->use_end();
+  for (Value::const_use_iterator UI = GV->use_begin(), E = GV->use_end();
        UI != E; ++UI) {
     const User *U = *UI;
     if (const StoreInst *SI = dyn_cast<StoreInst>(U)) {
index 4f5a70b3b2582ac13d1f91596cd39954305dad6f..f181f3a0a46fd536b56e36ceb960831a437a80dc 100644 (file)
@@ -68,7 +68,7 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
   // assignments to subsections of the memory unit.
 
   // Only allow direct and non-volatile loads and stores...
-  for (Value::use_const_iterator UI = AI->use_begin(), UE = AI->use_end();
+  for (Value::const_use_iterator UI = AI->use_begin(), UE = AI->use_end();
        UI != UE; ++UI)     // Loop over all of the uses of the alloca
     if (const LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
       if (LI->isVolatile())
index 10f88794f5a2a6125ae2b508fed6bdefd1452b63..c9c98577eb640950609a1cd373b3bd28b4d99378 100644 (file)
@@ -160,7 +160,7 @@ bool Constant::canTrap() const {
 /// isConstantUsed - Return true if the constant has users other than constant
 /// exprs and other dangling things.
 bool Constant::isConstantUsed() const {
-  for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
+  for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
     const Constant *UC = dyn_cast<Constant>(*UI);
     if (UC == 0 || isa<GlobalValue>(UC))
       return true;
index 575381e03035998128e0fa05b5da2a36fb380384..b55a371d6900a2c2ce969b1210e86690c001c1ee 100644 (file)
@@ -404,7 +404,7 @@ Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
 /// hasAddressTaken - returns true if there are any uses of this function
 /// other than direct calls or invokes to it.
 bool Function::hasAddressTaken(const User* *PutOffender) const {
-  for (Value::use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
+  for (Value::const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
     const User *U = *I;
     if (!isa<CallInst>(U) && !isa<InvokeInst>(U))
       return PutOffender ? (*PutOffender = U, true) : true;
index 489ec650e0715695577e851f0544ab9d47c57621..b758eb8702aeafecd0c2574017f119cb7e0a588d 100644 (file)
@@ -61,8 +61,8 @@ void GlobalValue::Dematerialize() {
 /// that want to check to see if a global is unused, but don't want to deal
 /// with potentially dead constants hanging off of the globals.
 void GlobalValue::removeDeadConstantUsers() const {
-  Value::use_const_iterator I = use_begin(), E = use_end();
-  Value::use_const_iterator LastNonDeadUser = E;
+  Value::const_use_iterator I = use_begin(), E = use_end();
+  Value::const_use_iterator LastNonDeadUser = E;
   while (I != E) {
     if (const Constant *User = dyn_cast<Constant>(*I)) {
       if (!removeDeadUsersOfConstant(User)) {
index 3fabfd07b316fe43f9e1b15e008e90cf9a34d71f..a37fe070bda044096ff478f227bb0333bedde2b7 100644 (file)
@@ -283,7 +283,7 @@ bool Instruction::isSameOperationAs(const Instruction *I) const {
 /// specified block.  Note that PHI nodes are considered to evaluate their
 /// operands in the corresponding predecessor block.
 bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {
-  for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
+  for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
     // PHI nodes uses values in the corresponding predecessor block.  For other
     // instructions, just check to see whether the parent of the use matches up.
     const PHINode *PN = dyn_cast<PHINode>(*UI);
index a36d2628250dc0a73f60d51daf2907f2960f3194..645dd5a21c7451850cb68aec4b68fbda2ec111c6 100644 (file)
@@ -86,7 +86,7 @@ Value::~Value() {
 /// hasNUses - Return true if this Value has exactly N users.
 ///
 bool Value::hasNUses(unsigned N) const {
-  use_const_iterator UI = use_begin(), E = use_end();
+  const_use_iterator UI = use_begin(), E = use_end();
 
   for (; N; --N, ++UI)
     if (UI == E) return false;  // Too few.
@@ -97,7 +97,7 @@ bool Value::hasNUses(unsigned N) const {
 /// logically equivalent to getNumUses() >= N.
 ///
 bool Value::hasNUsesOrMore(unsigned N) const {
-  use_const_iterator UI = use_begin(), E = use_end();
+  const_use_iterator UI = use_begin(), E = use_end();
 
   for (; N; --N, ++UI)
     if (UI == E) return false;  // Too few.
@@ -108,7 +108,7 @@ bool Value::hasNUsesOrMore(unsigned N) const {
 /// isUsedInBasicBlock - Return true if this value is used in the specified
 /// basic block.
 bool Value::isUsedInBasicBlock(const BasicBlock *BB) const {
-  for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
+  for (const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
     const Instruction *User = dyn_cast<Instruction>(*I);
     if (User && User->getParent() == BB)
       return true;