diff options
author | Alon Mishne <alon.mishne@intel.com> | 2014-03-18 09:41:07 +0000 |
---|---|---|
committer | Alon Mishne <alon.mishne@intel.com> | 2014-03-18 09:41:07 +0000 |
commit | 086494730d05626f5c95ecb3385682cea856faa7 (patch) | |
tree | 333f9b3e62c4e6364024fb47ba4be68f08c84ffe /lib/Transforms/Instrumentation | |
parent | fabbbc96ca70441f974b09eb33320d331fb36d1c (diff) | |
download | llvm-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/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/DebugIR.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp b/lib/Transforms/Instrumentation/DebugIR.cpp index 45e2c11c15..069886e071 100644 --- a/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/lib/Transforms/Instrumentation/DebugIR.cpp @@ -183,8 +183,8 @@ public: if (Finder.compile_unit_count() > 1) report_fatal_error("DebugIR pass supports only a signle compile unit per " "Module."); - createCompileUnit( - Finder.compile_unit_count() == 1 ? *Finder.compile_unit_begin() : 0); + createCompileUnit(Finder.compile_unit_count() == 1 ? + (MDNode*)*Finder.compile_units().begin() : 0); } void visitFunction(Function &F) { @@ -325,14 +325,11 @@ private: << " subprogram nodes" << "\n"); - for (DebugInfoFinder::iterator i = Finder.subprogram_begin(), - e = Finder.subprogram_end(); - i != e; ++i) { - DISubprogram S(*i); + for (DISubprogram S : Finder.subprograms()) { if (S.getFunction() == F) { - DEBUG(dbgs() << "Found DISubprogram " << *i << " for function " + DEBUG(dbgs() << "Found DISubprogram " << S << " for function " << S.getFunction() << "\n"); - return *i; + return S; } } DEBUG(dbgs() << "unable to find DISubprogram node for function " |