aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-10 19:56:59 +0000
committerChris Lattner <sabre@nondot.org>2004-01-10 19:56:59 +0000
commit737d3cd719969bda7aa94d102465b71d5ea47ad9 (patch)
tree6687e1a391351a505e67a5fc7214ee5b163b8289 /lib/Bytecode
parentae7fc3aede6205be456739f35e1ebfb7bfd2bd40 (diff)
Do not bother to emit a BytecodeBlock for an empty symbol table. This commonly
occurs when the symbol table for a module has been stripped, making all of the function local symbols go away. This saves 6728 bytes in the stripped bytecode file of 254.gap (which obviously has 841 functions), which isn't a ton, but helps and was easy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Writer/Writer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index 0e541df72d..308f1e9e1e 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/lib/Bytecode/Writer/Writer.cpp
@@ -236,6 +236,10 @@ void BytecodeWriter::outputFunction(const Function *F) {
}
void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) {
+ // Do not output the Bytecode block for an empty symbol table, it just wastes
+ // space!
+ if (MST.begin() == MST.end()) return;
+
BytecodeBlock FunctionBlock(BytecodeFormat::SymbolTable, Out);
for (SymbolTable::const_iterator TI = MST.begin(); TI != MST.end(); ++TI) {