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 | ad312155a6a357e3ed73232f8f945f2bd75886b4 (patch) | |
tree | ef1a15009d4b5cfad4d18242abd2543c87e75a03 /llvm/lib/Transforms/Instrumentation/DebugIR.cpp | |
parent | aa5b5f7b0d8f90f208bd070e000f166fa87d108a (diff) | |
download | bcm5719-llvm-ad312155a6a357e3ed73232f8f945f2bd75886b4.tar.gz bcm5719-llvm-ad312155a6a357e3ed73232f8f945f2bd75886b4.zip |
[C++11] Change DebugInfoFinder to use range-based loops
Also changes the iterators to return actual DI type over MDNode.
llvm-svn: 204130
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/DebugIR.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/DebugIR.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp index 45e2c11c152..069886e0719 100644 --- a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/llvm/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 " |