aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/ModuleDebugInfoPrinter.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-04-23 16:57:46 -0700
committerStephen Hines <srhines@google.com>2014-04-24 15:53:16 -0700
commit36b56886974eae4f9c5ebc96befd3e7bfe5de338 (patch)
treee6cfb69fbbd937f450eeb83bfb83b9da3b01275a /lib/Analysis/ModuleDebugInfoPrinter.cpp
parent69a8640022b04415ae9fac62f8ab090601d8f889 (diff)
downloadexternal_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.zip
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.gz
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.bz2
Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
Diffstat (limited to 'lib/Analysis/ModuleDebugInfoPrinter.cpp')
-rw-r--r--lib/Analysis/ModuleDebugInfoPrinter.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/Analysis/ModuleDebugInfoPrinter.cpp b/lib/Analysis/ModuleDebugInfoPrinter.cpp
index 0341537..f645558 100644
--- a/lib/Analysis/ModuleDebugInfoPrinter.cpp
+++ b/lib/Analysis/ModuleDebugInfoPrinter.cpp
@@ -17,8 +17,7 @@
#include "llvm/Analysis/Passes.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/DebugInfo.h"
+#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Pass.h"
#include "llvm/Support/ErrorHandling.h"
@@ -34,12 +33,12 @@ namespace {
initializeModuleDebugInfoPrinterPass(*PassRegistry::getPassRegistry());
}
- virtual bool runOnModule(Module &M);
+ bool runOnModule(Module &M) override;
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
- virtual void print(raw_ostream &O, const Module *M) const;
+ void print(raw_ostream &O, const Module *M) const override;
};
}
@@ -57,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';
}
}