diff options
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/StripSymbols.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/DebugIR.cpp | 13 | ||||
-rw-r--r-- | lib/Transforms/Utils/CloneFunction.cpp | 10 |
3 files changed, 8 insertions, 20 deletions
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 33c834058c..6d0be8fac2 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -306,10 +306,7 @@ bool StripDeadDebugInfo::runOnModule(Module &M) { SmallVector<Value *, 64> LiveSubprograms; DenseSet<const MDNode *> VisitedSet; - for (DebugInfoFinder::iterator CI = F.compile_unit_begin(), - CE = F.compile_unit_end(); CI != CE; ++CI) { - // Create our compile unit. - DICompileUnit DIC(*CI); + for (DICompileUnit DIC : F.compile_units()) { assert(DIC.Verify() && "DIC must verify as a DICompileUnit."); // Create our live subprogram list. 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 " 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 |