summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-22 17:52:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-22 17:52:52 +0000
commit2d6bae2e098ce3fef4f330edf4a53c396c6b9295 (patch)
tree30123d568be4e8978ead1c3bbcd9465b5d63f543 /llvm/lib/MC/MachObjectWriter.cpp
parentee512e58a32f6a653ab47f2c8272e459b03c0bd8 (diff)
downloadbcm5719-llvm-2d6bae2e098ce3fef4f330edf4a53c396c6b9295.tar.gz
bcm5719-llvm-2d6bae2e098ce3fef4f330edf4a53c396c6b9295.zip
Bring r240130 back.
Now that pr23900 is fixed, we can bring it back with no changes. Original message: 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: 240302
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp3
1 files changed, 2 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud