mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
[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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user