diff options
author | Eric Christopher <echristo@gmail.com> | 2013-02-06 21:53:56 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-02-06 21:53:56 +0000 |
commit | 5b33b3c3be61f7e48462a405f1eb7ad5a8e915aa (patch) | |
tree | ce90771616cfc573f06497bac3685ab17ddecc32 /llvm/lib/CodeGen/AsmPrinter | |
parent | 30be9f8ceecf76e865717080b6e442f8c699f924 (diff) | |
download | bcm5719-llvm-5b33b3c3be61f7e48462a405f1eb7ad5a8e915aa.tar.gz bcm5719-llvm-5b33b3c3be61f7e48462a405f1eb7ad5a8e915aa.zip |
Clean up multiple skeleton compile units if we have multiple compile
units coming in.
llvm-svn: 174548
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 85d5af57acf..3b8bebea16a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -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; } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index df3dc11c003..fb9020291ef 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -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; |