llvm.org GIT mirror llvm / f4387d9
Make the StringMaps attached to MCContext use the MCContext's allocator; reduces the number of calls to malloc(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129687 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Friedman 9 years ago
2 changed file(s) with 11 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
4444
4545 const TargetAsmInfo *TAI;
4646
47 /// Allocator - Allocator object used for creating machine code objects.
48 ///
49 /// We use a bump pointer allocator to avoid the need to track all allocated
50 /// objects.
51 BumpPtrAllocator Allocator;
52
4753 /// Symbols - Bindings of names to symbols.
48 StringMap> Symbols;
54 StringMap, BumpPtrAllocator&> Symbols;
4955
5056 /// UsedNames - Keeps tracks of names that were used both for used declared
5157 /// and artificial symbols.
52 StringMap> UsedNames;
58 StringMap, BumpPtrAllocator&> UsedNames;
5359
5460 /// NextUniqueID - The next ID to dole out to an unnamed assembler temporary
5561 /// symbol.
94100 /// We need a deterministic iteration order, so we remember the order
95101 /// the elements were added.
96102 std::vector MCLineSectionOrder;
97
98 /// Allocator - Allocator object used for creating machine code objects.
99 ///
100 /// We use a bump pointer allocator to avoid the need to track all allocated
101 /// objects.
102 BumpPtrAllocator Allocator;
103103
104104 void *MachOUniquingMap, *ELFUniquingMap, *COFFUniquingMap;
105105
2626
2727
2828 MCContext::MCContext(const MCAsmInfo &mai, const TargetAsmInfo *tai) :
29 MAI(mai), TAI(tai), NextUniqueID(0),
29 MAI(mai), TAI(tai),
30 Allocator(), Symbols(Allocator), UsedNames(Allocator),
31 NextUniqueID(0),
3032 CurrentDwarfLoc(0,0,0,DWARF2_FLAG_IS_STMT,0,0),
3133 AllowTemporaryLabels(true) {
3234 MachOUniquingMap = 0;