From 284a750c5ff95a29cd8cc9130d3eb7ec6d25e352 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 19 Jun 2015 12:16:55 +0000 Subject: Make all temporary symbols unnamed. What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240130 --- llvm/lib/MC/MachObjectWriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/MC/MachObjectWriter.cpp') diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index 8ce6127e386..d7934ad80c6 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -565,7 +565,8 @@ void MachObjectWriter::computeSymbolTable( MachSymbolData MSD; MSD.Symbol = &Symbol; - MSD.StringIndex = StringTable.getOffset(Symbol.getName()); + StringRef Name = Symbol.getName(); + MSD.StringIndex = Name.empty() ? 0 : StringTable.getOffset(Name); if (Symbol.isAbsolute()) { MSD.SectionIndex = 0; -- cgit v1.2.3