mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-30 00:32:53 +00:00
Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261524 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
54e0fe8d68
commit
b0ce7c7fb5
@ -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);
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user