summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils
diff options
context:
space:
mode:
authorAlon Mishne <alon.mishne@intel.com>2014-03-18 09:41:07 +0000
committerAlon Mishne <alon.mishne@intel.com>2014-03-18 09:41:07 +0000
commit086494730d05626f5c95ecb3385682cea856faa7 (patch)
tree333f9b3e62c4e6364024fb47ba4be68f08c84ffe /lib/Transforms/Utils
parentfabbbc96ca70441f974b09eb33320d331fb36d1c (diff)
downloadllvm-086494730d05626f5c95ecb3385682cea856faa7.tar.gz
llvm-086494730d05626f5c95ecb3385682cea856faa7.tar.bz2
llvm-086494730d05626f5c95ecb3385682cea856faa7.tar.xz
[C++11] Change DebugInfoFinder to use range-based loops
Also changes the iterators to return actual DI type over MDNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index 22222112f1..8df3ca0f15 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -154,10 +154,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
// Find the MDNode which corresponds to the DISubprogram data that described F.
static MDNode* FindSubprogram(const Function *F, DebugInfoFinder &Finder) {
- for (DebugInfoFinder::iterator I = Finder.subprogram_begin(),
- E = Finder.subprogram_end();
- I != E; ++I) {
- DISubprogram Subprogram(*I);
+ for (DISubprogram Subprogram : Finder.subprograms()) {
if (Subprogram.describes(F)) return Subprogram;
}
return NULL;
@@ -190,10 +187,7 @@ static void CloneDebugInfoMetadata(Function *NewFunc, const Function *OldFunc,
VMap[OldFunc] = NewFunc;
DISubprogram NewSubprogram(MapValue(OldSubprogramMDNode, VMap));
- for (DebugInfoFinder::iterator CUIter = Finder.compile_unit_begin(),
- CUEnd = Finder.compile_unit_end(); CUIter != CUEnd; ++CUIter) {
- DICompileUnit CU(*CUIter);
-
+ for (DICompileUnit CU : Finder.compile_units()) {
DIArray Subprograms(CU.getSubprograms());
// If the compile unit's function list contains the old function, it should