mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04: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:
@@ -56,31 +56,27 @@ bool ModuleDebugInfoPrinter::runOnModule(Module &M) {
|
||||
}
|
||||
|
||||
void ModuleDebugInfoPrinter::print(raw_ostream &O, const Module *M) const {
|
||||
for (DebugInfoFinder::iterator I = Finder.compile_unit_begin(),
|
||||
E = Finder.compile_unit_end(); I != E; ++I) {
|
||||
for (DICompileUnit CU : Finder.compile_units()) {
|
||||
O << "Compile Unit: ";
|
||||
DICompileUnit(*I).print(O);
|
||||
CU.print(O);
|
||||
O << '\n';
|
||||
}
|
||||
|
||||
for (DebugInfoFinder::iterator I = Finder.subprogram_begin(),
|
||||
E = Finder.subprogram_end(); I != E; ++I) {
|
||||
for (DISubprogram S : Finder.subprograms()) {
|
||||
O << "Subprogram: ";
|
||||
DISubprogram(*I).print(O);
|
||||
S.print(O);
|
||||
O << '\n';
|
||||
}
|
||||
|
||||
for (DebugInfoFinder::iterator I = Finder.global_variable_begin(),
|
||||
E = Finder.global_variable_end(); I != E; ++I) {
|
||||
for (DIGlobalVariable GV : Finder.global_variables()) {
|
||||
O << "GlobalVariable: ";
|
||||
DIGlobalVariable(*I).print(O);
|
||||
GV.print(O);
|
||||
O << '\n';
|
||||
}
|
||||
|
||||
for (DebugInfoFinder::iterator I = Finder.type_begin(),
|
||||
E = Finder.type_end(); I != E; ++I) {
|
||||
for (DIType T : Finder.types()) {
|
||||
O << "Type: ";
|
||||
DIType(*I).print(O);
|
||||
T.print(O);
|
||||
O << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user