[llvm] r207701 - Fix the clang-cl self-host build by defining ~DwarfDebug out of line

Reid Kleckner reid at kleckner.net
Wed Apr 30 13:34:31 PDT 2014


Author: rnk
Date: Wed Apr 30 15:34:31 2014
New Revision: 207701

URL: http://llvm.org/viewvc/llvm-project?rev=207701&view=rev
Log:
Fix the clang-cl self-host build by defining ~DwarfDebug out of line

DwarfDebug.h has a SmallVector member containing a unique_ptr of an
incomplete type.  MSVC doesn't have key functions, so the vtable and
dtor are emitted in AsmPrinter.cpp, where DwarfDebug's ctor is called.
AsmPrinter.cpp include DwarfUnit.h and doesn't get a complete definition
of DwarfTypeUnit.  We could fix the problem by including DwarfUnit.h in
DwarfDebug.h, but that would increase header bloat.  Instead, define
~DwarfDebug out of line.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=207701&r1=207700&r2=207701&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Apr 30 15:34:31 2014
@@ -218,6 +218,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Mo
   }
 }
 
+// Define out of line so we don't have to include DwarfUnit.h in DwarfDebug.h.
+DwarfDebug::~DwarfDebug() { }
+
 // Switch to the specified MCSection and emit an assembler
 // temporary label to it if SymbolStem is specified.
 static MCSymbol *emitSectionSym(AsmPrinter *Asm, const MCSection *Section,

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=207701&r1=207700&r2=207701&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Apr 30 15:34:31 2014
@@ -557,6 +557,8 @@ public:
   //
   DwarfDebug(AsmPrinter *A, Module *M);
 
+  ~DwarfDebug() override;
+
   void insertDIE(const MDNode *TypeMD, DIE *Die) {
     MDTypeNodeToDieMap.insert(std::make_pair(TypeMD, Die));
   }





More information about the llvm-commits mailing list