projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LazyValueInfo: range'ify some for-loops. No functional change.
[oota-llvm.git]
/
lib
/
Analysis
/
ModuleDebugInfoPrinter.cpp
diff --git
a/lib/Analysis/ModuleDebugInfoPrinter.cpp
b/lib/Analysis/ModuleDebugInfoPrinter.cpp
index cf8988a403cf0d3bfb45c3bd6f01867a13eab71a..f645558bd814a1e2ad1848e4014f85611f712bd6 100644
(file)
--- a/
lib/Analysis/ModuleDebugInfoPrinter.cpp
+++ b/
lib/Analysis/ModuleDebugInfoPrinter.cpp
@@
-16,13
+16,12
@@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/Passes.h"
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/DebugInfo.h"
-#include "llvm/Assembly/Writer.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/IR/DebugInfo.h"
+#include "llvm/IR/Function.h"
#include "llvm/Pass.h"
#include "llvm/Pass.h"
-#include "llvm/Function.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/ADT/Statistic.h"
using namespace llvm;
namespace {
using namespace llvm;
namespace {
@@
-30,20
+29,22
@@
namespace {
DebugInfoFinder Finder;
public:
static char ID; // Pass identification, replacement for typeid
DebugInfoFinder Finder;
public:
static char ID; // Pass identification, replacement for typeid
- ModuleDebugInfoPrinter() : ModulePass(&ID) {}
+ ModuleDebugInfoPrinter() : ModulePass(ID) {
+ initializeModuleDebugInfoPrinterPass(*PassRegistry::getPassRegistry());
+ }
-
virtual bool runOnModule(Module &M)
;
+
bool runOnModule(Module &M) override
;
- v
irtual void getAnalysisUsage(AnalysisUsage &AU) const
{
+ v
oid getAnalysisUsage(AnalysisUsage &AU) const override
{
AU.setPreservesAll();
}
AU.setPreservesAll();
}
- v
irtual void print(raw_ostream &O, const Module *M) const
;
+ v
oid print(raw_ostream &O, const Module *M) const override
;
};
}
char ModuleDebugInfoPrinter::ID = 0;
INITIALIZE_PASS(ModuleDebugInfoPrinter, "module-debuginfo",
};
}
char ModuleDebugInfoPrinter::ID = 0;
INITIALIZE_PASS(ModuleDebugInfoPrinter, "module-debuginfo",
- "Decodes module-level debug info", false, true)
;
+ "Decodes module-level debug info", false, true)
ModulePass *llvm::createModuleDebugInfoPrinterPass() {
return new ModuleDebugInfoPrinter();
ModulePass *llvm::createModuleDebugInfoPrinterPass() {
return new ModuleDebugInfoPrinter();
@@
-55,31
+56,27
@@
bool ModuleDebugInfoPrinter::runOnModule(Module &M) {
}
void ModuleDebugInfoPrinter::print(raw_ostream &O, const Module *M) const {
}
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: ";
O << "Compile Unit: ";
-
DICompileUnit(*I)
.print(O);
+
CU
.print(O);
O << '\n';
}
O << '\n';
}
- for (DebugInfoFinder::iterator I = Finder.subprogram_begin(),
- E = Finder.subprogram_end(); I != E; ++I) {
+ for (DISubprogram S : Finder.subprograms()) {
O << "Subprogram: ";
O << "Subprogram: ";
-
DISubprogram(*I)
.print(O);
+
S
.print(O);
O << '\n';
}
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: ";
O << "GlobalVariable: ";
-
DIGlobalVariable(*I)
.print(O);
+
GV
.print(O);
O << '\n';
}
O << '\n';
}
- for (DebugInfoFinder::iterator I = Finder.type_begin(),
- E = Finder.type_end(); I != E; ++I) {
+ for (DIType T : Finder.types()) {
O << "Type: ";
O << "Type: ";
-
DIType(*I)
.print(O);
+
T
.print(O);
O << '\n';
}
}
O << '\n';
}
}