From a117c712c7a38af0709032a7fc783231fc1b6b3e Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Fri, 11 Apr 2014 01:13:10 +0000 Subject: [PATCH] [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 --- lib/Target/ARM64/ARM64AddressTypePromotion.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/Target/ARM64/ARM64AddressTypePromotion.cpp b/lib/Target/ARM64/ARM64AddressTypePromotion.cpp index 444bb9de69a..b3d7b5c754b 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(*UseIt)) + for (const Use &U : SExt->uses()) { + if (isa(*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(*UseIt); + for (const Use &U : SExt->uses()) { + const Instruction *Inst = dyn_cast(U); if (Inst && Inst->getNumOperands() > 2) { DEBUG(dbgs() << "Interesting use in GetElementPtrInst\n" << *Inst << '\n');