diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-05-20 19:35:35 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-05-20 19:35:35 +0000 |
commit | 5973bc8a82dc585b1f08190e4baba389a17a880f (patch) | |
tree | fb8a180f9b9d569b1e49c054ba792069d54bd37c /llvm/lib | |
parent | 96c9ae6a20269a6dec5601f09c8ecf173a6f54ad (diff) | |
download | bcm5719-llvm-5973bc8a82dc585b1f08190e4baba389a17a880f.tar.gz bcm5719-llvm-5973bc8a82dc585b1f08190e4baba389a17a880f.zip |
CodeGen: Move the call to DwarfDebug::beginModule() out of the constructor.
This gives AsmPrinter a chance to initialize its DD field before
we call beginModule(), which is about to start using it.
Differential Revision: http://reviews.llvm.org/D20413
llvm-svn: 270258
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index e9335054275..4b910b08f5d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -253,6 +253,7 @@ bool AsmPrinter::doInitialization(Module &M) { } if (!EmitCodeView || MMI->getModule()->getDwarfVersion()) { DD = new DwarfDebug(this, &M); + DD->beginModule(); Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName)); } } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 52f5a02791e..0b279fb6f97 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -269,11 +269,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) UseDWARF2Bitfields = (DwarfVersion < 4) || tuneForGDB(); Asm->OutStreamer->getContext().setDwarfVersion(DwarfVersion); - - { - NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); - beginModule(); - } } // Define out of line so we don't have to include DwarfUnit.h in DwarfDebug.h. @@ -465,6 +460,7 @@ void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU, // global DIEs and emit initial debug info sections. This is invoked by // the target AsmPrinter. void DwarfDebug::beginModule() { + NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); if (DisableDebugInfoPrinting) return; |