summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-08 23:40:34 +0000
committerDevang Patel <dpatel@apple.com>2009-01-08 23:40:34 +0000
commitf646668799bd77ceebf73cd2f357d779f7abacf4 (patch)
tree7e86e09d257f06045a3cf0a770f5f2cab37fd8ab /llvm/lib/CodeGen
parentbfd47a3c00bbceaa1bf55ce9be8f763a2a94e886 (diff)
downloadbcm5719-llvm-f646668799bd77ceebf73cd2f357d779f7abacf4.tar.gz
bcm5719-llvm-f646668799bd77ceebf73cd2f357d779f7abacf4.zip
Convert DwarfWriter into a pass.
Now Users request DwarfWriter through getAnalysisUsage() instead of creating an instance of DwarfWriter object directly. llvm-svn: 61955
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 16d1531a47f..6293590fd67 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -43,6 +43,10 @@
using namespace llvm;
using namespace llvm::dwarf;
+static RegisterPass<DwarfWriter>
+X("dwarfwriter", "DWARF Information Writer");
+char DwarfWriter::ID = 0;
+
namespace llvm {
//===----------------------------------------------------------------------===//
@@ -4897,10 +4901,7 @@ void DIE::dump() {
/// DwarfWriter Implementation
///
-DwarfWriter::DwarfWriter(raw_ostream &OS, AsmPrinter *A,
- const TargetAsmInfo *T) {
- DE = new DwarfException(OS, A, T);
- DD = new DwarfDebug(OS, A, T);
+DwarfWriter::DwarfWriter() : ImmutablePass(&ID), DD(NULL), DE(NULL) {
}
DwarfWriter::~DwarfWriter() {
@@ -4908,18 +4909,18 @@ DwarfWriter::~DwarfWriter() {
delete DD;
}
-/// SetModuleInfo - Set machine module info when it's known that pass manager
-/// has created it. Set by the target AsmPrinter.
-void DwarfWriter::SetModuleInfo(MachineModuleInfo *MMI) {
- DD->SetModuleInfo(MMI);
- DE->SetModuleInfo(MMI);
-}
-
/// BeginModule - Emit all Dwarf sections that should come prior to the
/// content.
-void DwarfWriter::BeginModule(Module *M) {
+void DwarfWriter::BeginModule(Module *M,
+ MachineModuleInfo *MMI,
+ raw_ostream &OS, AsmPrinter *A,
+ const TargetAsmInfo *T) {
+ DE = new DwarfException(OS, A, T);
+ DD = new DwarfDebug(OS, A, T);
DE->BeginModule(M);
DD->BeginModule(M);
+ DD->SetModuleInfo(MMI);
+ DE->SetModuleInfo(MMI);
}
/// EndModule - Emit all Dwarf sections that should come after the content.
OpenPOWER on IntegriCloud