summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-15 21:06:57 +0000
committerChris Lattner <sabre@nondot.org>2004-01-15 21:06:57 +0000
commit4c57267eceb7da7afb54491c37ea618d819d2e2f (patch)
tree8b7d02df19b530b02dc81bd2f0e4401cbe2a6bc7 /llvm/lib/Bytecode/Writer/Writer.cpp
parent2d0e6f63268cb67ee407ddf48c4b2710d40af83c (diff)
downloadbcm5719-llvm-4c57267eceb7da7afb54491c37ea618d819d2e2f.tar.gz
bcm5719-llvm-4c57267eceb7da7afb54491c37ea618d819d2e2f.zip
If these blocks are empty, there is no reason to even emit the bytecode blocks.
This saves about 15K in 176.gcc, coupled with another patch that I'm working on. llvm-svn: 10889
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index 5675b2af491..6467921d053 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -164,7 +164,8 @@ void BytecodeWriter::outputConstantsInPlane(const std::vector<const Value*>
void BytecodeWriter::outputConstants(bool isFunction) {
ConstantTotalBytes -= Out.size();
if (isFunction) FunctionConstantTotalBytes -= Out.size();
- BytecodeBlock CPool(BytecodeFormat::ConstantPool, Out);
+ BytecodeBlock CPool(BytecodeFormat::ConstantPool, Out,
+ true /* Elide block if empty */);
unsigned NumPlanes = Table.getNumPlanes();
@@ -286,7 +287,8 @@ void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) {
SymTabBytes -= Out.size();
- BytecodeBlock SymTabBlock(BytecodeFormat::SymbolTable, Out);
+ BytecodeBlock SymTabBlock(BytecodeFormat::SymbolTable, Out,
+ true/* ElideIfEmpty*/);
for (SymbolTable::const_iterator TI = MST.begin(); TI != MST.end(); ++TI) {
SymbolTable::type_const_iterator I = MST.type_begin(TI->first);
OpenPOWER on IntegriCloud