Clean up multiple skeleton compile units if we have multiple compile

units coming in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2013-02-06 21:53:56 +00:00
parent 231b83d8fd
commit 01776a5a94
2 changed files with 6 additions and 8 deletions

View File

@ -159,7 +159,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
PrevLabel(NULL), GlobalCUIndexCount(0),
InfoHolder(A, &AbbreviationsSet, &Abbreviations, "info_string",
DIEValueAllocator),
SkeletonCU(0),
SkeletonAbbrevSet(InitAbbreviationsSetSize),
SkeletonHolder(A, &SkeletonAbbrevSet, &SkeletonAbbrevs, "skel_string",
DIEValueAllocator) {
@ -1040,11 +1039,12 @@ void DwarfDebug::endModule() {
E = CUMap.end(); I != E; ++I)
delete I->second;
delete SkeletonCU;
for (SmallVector<CompileUnit *, 1>::iterator I = SkeletonCUs.begin(),
E = SkeletonCUs.end(); I != E; ++I)
delete *I;
// Reset these for the next Module if we have one.
FirstCU = NULL;
SkeletonCU = NULL;
}
// Find abstract variable, if any, associated with Var.
@ -2496,10 +2496,8 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const MDNode *N) {
if (!CompilationDir.empty())
NewCU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
if (!SkeletonCU)
SkeletonCU = NewCU;
SkeletonHolder.addUnit(NewCU);
SkeletonCUs.push_back(NewCU);
return NewCU;
}

View File

@ -415,8 +415,8 @@ class DwarfDebug {
// original object file, rather than things that are meant
// to be in the .dwo sections.
// The CU left in the original object file for separated debug info.
CompileUnit *SkeletonCU;
// The CUs left in the original object file for separated debug info.
SmallVector<CompileUnit *, 1> SkeletonCUs;
// Used to uniquely define abbreviations for the skeleton emission.
FoldingSet<DIEAbbrev> SkeletonAbbrevSet;