Allocate the contents of DwarfDebug's StringMaps in a single big BumpPtrAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-06-09 10:34:15 +00:00
parent af0d459e36
commit f33a79c590
2 changed files with 6 additions and 5 deletions

View File

@ -126,6 +126,7 @@ DIType DbgVariable::getType() const {
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
: Asm(A), MMI(Asm->MMI), FirstCU(0), : Asm(A), MMI(Asm->MMI), FirstCU(0),
AbbreviationsSet(InitAbbreviationsSetSize), AbbreviationsSet(InitAbbreviationsSetSize),
SourceIdMap(DIEValueAllocator), StringPool(DIEValueAllocator),
PrevLabel(NULL) { PrevLabel(NULL) {
NextStringPoolNumber = 0; NextStringPoolNumber = 0;

View File

@ -188,6 +188,9 @@ class DwarfDebug {
/// MMI - Collected machine module information. /// MMI - Collected machine module information.
MachineModuleInfo *MMI; MachineModuleInfo *MMI;
/// DIEValueAllocator - All DIEValues are allocated through this allocator.
BumpPtrAllocator DIEValueAllocator;
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Attributes used to construct specific Dwarf sections. // Attributes used to construct specific Dwarf sections.
// //
@ -210,11 +213,11 @@ class DwarfDebug {
/// SourceIdMap - Source id map, i.e. pair of source filename and directory, /// SourceIdMap - Source id map, i.e. pair of source filename and directory,
/// separated by a zero byte, mapped to a unique id. /// separated by a zero byte, mapped to a unique id.
StringMap<unsigned> SourceIdMap; StringMap<unsigned, BumpPtrAllocator&> SourceIdMap;
/// StringPool - A String->Symbol mapping of strings used by indirect /// StringPool - A String->Symbol mapping of strings used by indirect
/// references. /// references.
StringMap<std::pair<MCSymbol*, unsigned> > StringPool; StringMap<std::pair<MCSymbol*, unsigned>, BumpPtrAllocator&> StringPool;
unsigned NextStringPoolNumber; unsigned NextStringPoolNumber;
/// SectionMap - Provides a unique id per text section. /// SectionMap - Provides a unique id per text section.
@ -292,9 +295,6 @@ class DwarfDebug {
std::vector<FunctionDebugFrameInfo> DebugFrames; std::vector<FunctionDebugFrameInfo> DebugFrames;
// DIEValueAllocator - All DIEValues are allocated through this allocator.
BumpPtrAllocator DIEValueAllocator;
// Section Symbols: these are assembler temporary labels that are emitted at // Section Symbols: these are assembler temporary labels that are emitted at
// the beginning of each supported dwarf section. These are used to form // the beginning of each supported dwarf section. These are used to form
// section offsets and are created by EmitSectionLabels. // section offsets and are created by EmitSectionLabels.