diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-03-27 23:30:04 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-03-27 23:30:04 +0000 |
commit | cf6f4c8c34bb4026fdc1dc455c4362d2c35b495b (patch) | |
tree | c55893c8e0f21ea784bab2196630a440f6a63849 /lib | |
parent | e2ee98ab169fe8d1d4bd39fe0ecb89274eceb438 (diff) | |
download | llvm-cf6f4c8c34bb4026fdc1dc455c4362d2c35b495b.tar.gz llvm-cf6f4c8c34bb4026fdc1dc455c4362d2c35b495b.tar.bz2 llvm-cf6f4c8c34bb4026fdc1dc455c4362d2c35b495b.tar.xz |
C++11: convert verbose loops to range-based loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 15f0035819..9d0be8be9c 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -1036,17 +1036,16 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI, bool llvm::LowerDbgDeclare(Function &F) { DIBuilder DIB(*F.getParent()); SmallVector<DbgDeclareInst *, 4> Dbgs; - for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) - for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { - if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) + for (auto &FI : F) + for (BasicBlock::iterator BI : FI) + if (auto DDI = dyn_cast<DbgDeclareInst>(BI)) Dbgs.push_back(DDI); - } + if (Dbgs.empty()) return false; - for (SmallVectorImpl<DbgDeclareInst *>::iterator I = Dbgs.begin(), - E = Dbgs.end(); I != E; ++I) { - DbgDeclareInst *DDI = *I; + for (auto &I : Dbgs) { + DbgDeclareInst *DDI = I; AllocaInst *AI = dyn_cast_or_null<AllocaInst>(DDI->getAddress()); // If this is an alloca for a scalar variable, insert a dbg.value // at each load and store to the alloca and erase the dbg.declare. |