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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240130 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-06-19 12:16:55 +00:00
parent 4b77d12064
commit ec77d9ad83
25 changed files with 125 additions and 130 deletions

View File

@ -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;