diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-02-22 13:11:58 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-02-22 13:11:58 +0000 |
commit | 451f54cf62347d80cd0de6f5597010137b787d00 (patch) | |
tree | 4475648e854c297703935843ea0df45e2d684733 /llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | |
parent | 0f6f82a3a8871dfcd37dae41e233439f58fa674b (diff) | |
download | llvm-451f54cf62347d80cd0de6f5597010137b787d00.zip llvm-451f54cf62347d80cd0de6f5597010137b787d00.tar.gz llvm-451f54cf62347d80cd0de6f5597010137b787d00.tar.bz2 |
Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.
llvm-svn: 261524
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp index 7920240..9ca389f 100644 --- a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp +++ b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp @@ -119,7 +119,7 @@ class PPCBoolRetToInt : public FunctionPass { Promotable.insert(P); SmallVector<const PHINode *, 8> ToRemove; - for (const auto &P : Promotable) { + for (const PHINode *P : Promotable) { // Condition 2 and 3 auto IsValidUser = [] (const Value *V) -> bool { return isa<ReturnInst>(V) || isa<CallInst>(V) || isa<PHINode>(V) || @@ -146,7 +146,7 @@ class PPCBoolRetToInt : public FunctionPass { Promotable.erase(User); ToRemove.clear(); - for (const auto &P : Promotable) { + for (const PHINode *P : Promotable) { // Condition 4 and 5 const auto &Users = P->users(); const auto &Operands = P->operands(); @@ -199,11 +199,11 @@ class PPCBoolRetToInt : public FunctionPass { // Presently, we only know how to handle PHINode, Constant, and Arguments. // Potentially, bitwise operations (AND, OR, XOR, NOT) and sign extension // could also be handled in the future. - for (const auto &V : Defs) + for (Value *V : Defs) if (!isa<PHINode>(V) && !isa<Constant>(V) && !isa<Argument>(V)) return false; - for (const auto &V : Defs) + for (Value *V : Defs) if (const PHINode *P = dyn_cast<PHINode>(V)) if (!PromotablePHINodes.count(P)) return false; @@ -214,7 +214,7 @@ class PPCBoolRetToInt : public FunctionPass { ++NumBoolCallPromotion; ++NumBoolToIntPromotion; - for (const auto &V : Defs) + for (Value *V : Defs) if (!BoolToIntMap.count(V)) BoolToIntMap[V] = translate(V); |