From ad312155a6a357e3ed73232f8f945f2bd75886b4 Mon Sep 17 00:00:00 2001 From: Alon Mishne Date: Tue, 18 Mar 2014 09:41:07 +0000 Subject: [C++11] Change DebugInfoFinder to use range-based loops Also changes the iterators to return actual DI type over MDNode. llvm-svn: 204130 --- llvm/lib/Transforms/Instrumentation/DebugIR.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Transforms/Instrumentation/DebugIR.cpp') 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 " -- cgit v1.2.3