1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.

llvm-svn: 261524
This commit is contained in:
Benjamin Kramer 2016-02-22 13:11:58 +00:00
parent 0f4267c518
commit e5027dce2c
3 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -473,7 +473,7 @@ void MemorySSA::verifyDomination(Function &F) const {
if (!MD)
continue;
for (const auto &U : MD->users()) {
for (User *U : MD->users()) {
BasicBlock *UseBlock;
// Things are allowed to flow to phi nodes over their predecessor edge.
if (auto *P = dyn_cast<MemoryPhi>(U)) {

View File

@ -364,7 +364,7 @@ static void getObjectCoveragePoints(const object::ObjectFile &O,
if (SanCovAddrs.empty())
Fail("__sanitizer_cov* functions not found");
for (const auto Section : O.sections()) {
for (object::SectionRef Section : O.sections()) {
if (Section.isVirtual() || !Section.isText()) // llvm-objdump does the same.
continue;
uint64_t SectionAddr = Section.getAddress();