Skip to content

Commit

Permalink
Fix the clang-cl self-host build by defining ~DwarfDebug out of line
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207701 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rnk committed Apr 30, 2014
1 parent 6f32742 commit 79844fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
}
}

// 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,
Expand Down
2 changes: 2 additions & 0 deletions lib/CodeGen/AsmPrinter/DwarfDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ class DwarfDebug : public AsmPrinterHandler {
//
DwarfDebug(AsmPrinter *A, Module *M);

~DwarfDebug() override;

void insertDIE(const MDNode *TypeMD, DIE *Die) {
MDTypeNodeToDieMap.insert(std::make_pair(TypeMD, Die));
}
Expand Down

0 comments on commit 79844fc

Please sign in to comment.