Skip to content

Commit c78d720

Browse files
committed
rename use_const_iterator to const_use_iterator for consistency's sake
llvm-svn: 99564
1 parent d821f4a commit c78d720

16 files changed

+22
-22
lines changed

Diff for: llvm/include/llvm/Support/CFG.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class PredIterator : public std::iterator<std::forward_iterator_tag,
6767

6868
typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
6969
typedef PredIterator<const BasicBlock,
70-
Value::use_const_iterator> pred_const_iterator;
70+
Value::const_use_iterator> pred_const_iterator;
7171

7272
inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
7373
inline pred_const_iterator pred_begin(const BasicBlock *BB) {

Diff for: llvm/include/llvm/Support/CallSite.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class CallSite {
196196
bool isCallee(Value::use_iterator UI) const {
197197
return getCallee() == &UI.getUse();
198198
}
199-
bool isCallee(Value::use_const_iterator UI) const {
199+
bool isCallee(Value::const_use_iterator UI) const {
200200
return getCallee() == &UI.getUse();
201201
}
202202
private:

Diff for: llvm/include/llvm/Value.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ class Value {
157157
// Methods for handling the chain of uses of this Value.
158158
//
159159
typedef value_use_iterator<User> use_iterator;
160-
typedef value_use_iterator<const User> use_const_iterator;
160+
typedef value_use_iterator<const User> const_use_iterator;
161161

162162
bool use_empty() const { return UseList == 0; }
163163
use_iterator use_begin() { return use_iterator(UseList); }
164-
use_const_iterator use_begin() const { return use_const_iterator(UseList); }
164+
const_use_iterator use_begin() const { return const_use_iterator(UseList); }
165165
use_iterator use_end() { return use_iterator(0); }
166-
use_const_iterator use_end() const { return use_const_iterator(0); }
166+
const_use_iterator use_end() const { return const_use_iterator(0); }
167167
User *use_back() { return *use_begin(); }
168168
const User *use_back() const { return *use_begin(); }
169169

@@ -172,7 +172,7 @@ class Value {
172172
/// traversing the whole use list.
173173
///
174174
bool hasOneUse() const {
175-
use_const_iterator I = use_begin(), E = use_end();
175+
const_use_iterator I = use_begin(), E = use_end();
176176
if (I == E) return false;
177177
return ++I == E;
178178
}

Diff for: llvm/lib/Analysis/CaptureTracking.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool llvm::PointerMayBeCaptured(const Value *V,
4949
SmallSet<Use*, Threshold> Visited;
5050
int Count = 0;
5151

52-
for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();
52+
for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
5353
UI != UE; ++UI) {
5454
// If there are lots of uses, conservatively say that the value
5555
// is captured to avoid taking too much compile time.

Diff for: llvm/lib/Analysis/LiveValues.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ LiveValues::Memo &LiveValues::compute(const Value *V) {
125125
bool LiveOutOfDefBB = false;
126126

127127
// Examine each use of the value.
128-
for (Value::use_const_iterator I = V->use_begin(), E = V->use_end();
128+
for (Value::const_use_iterator I = V->use_begin(), E = V->use_end();
129129
I != E; ++I) {
130130
const User *U = *I;
131131
const BasicBlock *UseBB = cast<Instruction>(U)->getParent();

Diff for: llvm/lib/Analysis/MemoryBuiltins.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ const PointerType *llvm::getMallocType(const CallInst *CI) {
139139
unsigned NumOfBitCastUses = 0;
140140

141141
// Determine if CallInst has a bitcast use.
142-
for (Value::use_const_iterator UI = CI->use_begin(), E = CI->use_end();
142+
for (Value::const_use_iterator UI = CI->use_begin(), E = CI->use_end();
143143
UI != E; )
144144
if (const BitCastInst *BCI = dyn_cast<BitCastInst>(*UI++)) {
145145
MallocType = cast<PointerType>(BCI->getDestTy());

Diff for: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ bool CodeGenPrepare::CanMergeBlocks(const BasicBlock *BB,
174174
// don't mess around with them.
175175
BasicBlock::const_iterator BBI = BB->begin();
176176
while (const PHINode *PN = dyn_cast<PHINode>(BBI++)) {
177-
for (Value::use_const_iterator UI = PN->use_begin(), E = PN->use_end();
177+
for (Value::const_use_iterator UI = PN->use_begin(), E = PN->use_end();
178178
UI != E; ++UI) {
179179
const Instruction *User = cast<Instruction>(*UI);
180180
if (User->getParent() != DestBB || !isa<PHINode>(User))

Diff for: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ LSRInstance::CollectLoopInvariantFixupsAndFormulae() {
18991899
const Value *V = U->getValue();
19001900
if (const Instruction *Inst = dyn_cast<Instruction>(V))
19011901
if (L->contains(Inst)) continue;
1902-
for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();
1902+
for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
19031903
UI != UE; ++UI) {
19041904
const Instruction *UserInst = dyn_cast<Instruction>(*UI);
19051905
// Ignore non-instructions.

Diff for: llvm/lib/Transforms/Scalar/Reg2Mem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace {
4545

4646
bool valueEscapes(const Instruction *Inst) const {
4747
const BasicBlock *BB = Inst->getParent();
48-
for (Value::use_const_iterator UI = Inst->use_begin(),E = Inst->use_end();
48+
for (Value::const_use_iterator UI = Inst->use_begin(),E = Inst->use_end();
4949
UI != E; ++UI)
5050
if (cast<Instruction>(*UI)->getParent() != BB ||
5151
isa<PHINode>(*UI))

Diff for: llvm/lib/Transforms/Scalar/SCCP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ static bool AddressIsTaken(const GlobalValue *GV) {
17091709
// Delete any dead constantexpr klingons.
17101710
GV->removeDeadConstantUsers();
17111711

1712-
for (Value::use_const_iterator UI = GV->use_begin(), E = GV->use_end();
1712+
for (Value::const_use_iterator UI = GV->use_begin(), E = GV->use_end();
17131713
UI != E; ++UI) {
17141714
const User *U = *UI;
17151715
if (const StoreInst *SI = dyn_cast<StoreInst>(U)) {

Diff for: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
6868
// assignments to subsections of the memory unit.
6969

7070
// Only allow direct and non-volatile loads and stores...
71-
for (Value::use_const_iterator UI = AI->use_begin(), UE = AI->use_end();
71+
for (Value::const_use_iterator UI = AI->use_begin(), UE = AI->use_end();
7272
UI != UE; ++UI) // Loop over all of the uses of the alloca
7373
if (const LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
7474
if (LI->isVolatile())

Diff for: llvm/lib/VMCore/Constants.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ bool Constant::canTrap() const {
160160
/// isConstantUsed - Return true if the constant has users other than constant
161161
/// exprs and other dangling things.
162162
bool Constant::isConstantUsed() const {
163-
for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
163+
for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
164164
const Constant *UC = dyn_cast<Constant>(*UI);
165165
if (UC == 0 || isa<GlobalValue>(UC))
166166
return true;

Diff for: llvm/lib/VMCore/Function.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
404404
/// hasAddressTaken - returns true if there are any uses of this function
405405
/// other than direct calls or invokes to it.
406406
bool Function::hasAddressTaken(const User* *PutOffender) const {
407-
for (Value::use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
407+
for (Value::const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
408408
const User *U = *I;
409409
if (!isa<CallInst>(U) && !isa<InvokeInst>(U))
410410
return PutOffender ? (*PutOffender = U, true) : true;

Diff for: llvm/lib/VMCore/Globals.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ void GlobalValue::Dematerialize() {
6161
/// that want to check to see if a global is unused, but don't want to deal
6262
/// with potentially dead constants hanging off of the globals.
6363
void GlobalValue::removeDeadConstantUsers() const {
64-
Value::use_const_iterator I = use_begin(), E = use_end();
65-
Value::use_const_iterator LastNonDeadUser = E;
64+
Value::const_use_iterator I = use_begin(), E = use_end();
65+
Value::const_use_iterator LastNonDeadUser = E;
6666
while (I != E) {
6767
if (const Constant *User = dyn_cast<Constant>(*I)) {
6868
if (!removeDeadUsersOfConstant(User)) {

Diff for: llvm/lib/VMCore/Instruction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ bool Instruction::isSameOperationAs(const Instruction *I) const {
283283
/// specified block. Note that PHI nodes are considered to evaluate their
284284
/// operands in the corresponding predecessor block.
285285
bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {
286-
for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
286+
for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
287287
// PHI nodes uses values in the corresponding predecessor block. For other
288288
// instructions, just check to see whether the parent of the use matches up.
289289
const PHINode *PN = dyn_cast<PHINode>(*UI);

Diff for: llvm/lib/VMCore/Value.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Value::~Value() {
8686
/// hasNUses - Return true if this Value has exactly N users.
8787
///
8888
bool Value::hasNUses(unsigned N) const {
89-
use_const_iterator UI = use_begin(), E = use_end();
89+
const_use_iterator UI = use_begin(), E = use_end();
9090

9191
for (; N; --N, ++UI)
9292
if (UI == E) return false; // Too few.
@@ -97,7 +97,7 @@ bool Value::hasNUses(unsigned N) const {
9797
/// logically equivalent to getNumUses() >= N.
9898
///
9999
bool Value::hasNUsesOrMore(unsigned N) const {
100-
use_const_iterator UI = use_begin(), E = use_end();
100+
const_use_iterator UI = use_begin(), E = use_end();
101101

102102
for (; N; --N, ++UI)
103103
if (UI == E) return false; // Too few.
@@ -108,7 +108,7 @@ bool Value::hasNUsesOrMore(unsigned N) const {
108108
/// isUsedInBasicBlock - Return true if this value is used in the specified
109109
/// basic block.
110110
bool Value::isUsedInBasicBlock(const BasicBlock *BB) const {
111-
for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
111+
for (const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
112112
const Instruction *User = dyn_cast<Instruction>(*I);
113113
if (User && User->getParent() == BB)
114114
return true;

0 commit comments

Comments
 (0)