diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-10 19:56:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-10 19:56:59 +0000 |
commit | a2bfab849f3555045415e470576798215072a7fa (patch) | |
tree | 11b31e88426e0add6f05c0e5acbc2db32c8f1dec /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | 8043f8c294fbd89dcba0ce75fcdfa93aeb910e4c (diff) | |
download | bcm5719-llvm-a2bfab849f3555045415e470576798215072a7fa.tar.gz bcm5719-llvm-a2bfab849f3555045415e470576798215072a7fa.zip |
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.
llvm-svn: 10750
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 0e541df72d0..308f1e9e1ef 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/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) { |