mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
AsmPrinter: Emit the DwarfStringPool offset directly when possible
Change `DwarfStringPool` to calculate byte offsets on-the-fly, and update `DwarfUnit::getLocalString()` to use a `DIEInteger` instead of a `DIEDelta` when Dwarf doesn't use relocations (i.e., Mach-O). This eliminates another call to `EmitLabelDifference()`, and drops memory usage from 865 MB down to 861 MB, around 0.5%. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -239,14 +239,13 @@ void DwarfUnit::addIndexedString(DIE &Die, dwarf::Attribute Attribute,
|
||||
|
||||
void DwarfUnit::addLocalString(DIE &Die, dwarf::Attribute Attribute,
|
||||
StringRef String) {
|
||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||
MCSymbol *Symb = DU->getStringPool().getSymbol(*Asm, String);
|
||||
DIEValue *Value;
|
||||
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||
Value = new (DIEValueAllocator) DIELabel(Symb);
|
||||
Value = new (DIEValueAllocator)
|
||||
DIELabel(DU->getStringPool().getSymbol(*Asm, String));
|
||||
else
|
||||
Value = new (DIEValueAllocator)
|
||||
DIEDelta(Symb, TLOF.getDwarfStrSection()->getBeginSymbol());
|
||||
DIEInteger(DU->getStringPool().getOffset(*Asm, String));
|
||||
DIEValue *Str = new (DIEValueAllocator) DIEString(Value, String);
|
||||
Die.addValue(Attribute, dwarf::DW_FORM_strp, Str);
|
||||
}
|
||||
|
Reference in New Issue
Block a user