diff options
author | Jim Grosbach <grosbach@apple.com> | 2014-04-11 01:13:10 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2014-04-11 01:13:10 +0000 |
commit | a117c712c7a38af0709032a7fc783231fc1b6b3e (patch) | |
tree | c042964be5599247d8eb812f099793f1002e0a4e | |
parent | e6cd1ac2d56b22fe6225e553d89c79b138b604bb (diff) | |
download | llvm-a117c712c7a38af0709032a7fc783231fc1b6b3e.tar.gz llvm-a117c712c7a38af0709032a7fc783231fc1b6b3e.tar.bz2 llvm-a117c712c7a38af0709032a7fc783231fc1b6b3e.tar.xz |
[ARM64,C++11] Range'ify use-lists iterators in address type promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206013 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM64/ARM64AddressTypePromotion.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Target/ARM64/ARM64AddressTypePromotion.cpp b/lib/Target/ARM64/ARM64AddressTypePromotion.cpp index 444bb9de69..b3d7b5c754 100644 --- a/lib/Target/ARM64/ARM64AddressTypePromotion.cpp +++ b/lib/Target/ARM64/ARM64AddressTypePromotion.cpp @@ -214,10 +214,8 @@ ARM64AddressTypePromotion::shouldConsiderSExt(const Instruction *SExt) const { if (SExt->getType() != ConsideredSExtType) return false; - for (Value::const_use_iterator UseIt = SExt->use_begin(), - EndUseIt = SExt->use_end(); - UseIt != EndUseIt; ++UseIt) { - if (isa<GetElementPtrInst>(*UseIt)) + for (const Use &U : SExt->uses()) { + if (isa<GetElementPtrInst>(*U)) return true; } @@ -438,10 +436,8 @@ void ARM64AddressTypePromotion::analyzeSExtension(Instructions &SExtInsts) { bool insert = false; // #1. - for (Value::use_iterator UseIt = SExt->use_begin(), - EndUseIt = SExt->use_end(); - UseIt != EndUseIt; ++UseIt) { - const Instruction *Inst = dyn_cast<GetElementPtrInst>(*UseIt); + for (const Use &U : SExt->uses()) { + const Instruction *Inst = dyn_cast<GetElementPtrInst>(U); if (Inst && Inst->getNumOperands() > 2) { DEBUG(dbgs() << "Interesting use in GetElementPtrInst\n" << *Inst << '\n'); |