summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-09-17 06:00:02 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-09-17 06:00:02 +0000
commita53d49e1b547a9658be46865d687aeb481b3b32c (patch)
tree6af44087ae1c06b8690e2a40259801c80049020b /llvm/lib/Bitcode/Writer
parent05188a646d9e5c097a9d18fcae397c6312fe786d (diff)
downloadbcm5719-llvm-a53d49e1b547a9658be46865d687aeb481b3b32c.tar.gz
bcm5719-llvm-a53d49e1b547a9658be46865d687aeb481b3b32c.zip
Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)
The ValueSymbolTable is used to detect name conflict and rename instructions automatically. This is not needed when the value names are automatically discarded by the LLVMContext. No functional change intended, just saving a little bit of memory. This is a recommit of r281806 after fixing the accessor to return a pointer instead of a reference and updating all the call-sites. llvm-svn: 281813
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index da6a8910318..0fd239f71cc 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -2999,7 +2999,8 @@ void ModuleBitcodeWriter::writeFunction(
}
// Emit names for all the instructions etc.
- writeValueSymbolTable(F.getValueSymbolTable());
+ if (auto *Symtab = F.getValueSymbolTable())
+ writeValueSymbolTable(*Symtab);
if (NeedsMetadataAttachment)
writeFunctionMetadataAttachment(F);
OpenPOWER on IntegriCloud