summaryrefslogtreecommitdiff
path: root/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
commit0baa0af86148200df4b7885e3b50855702f79b3a (patch)
tree517d1c34b864170944ea6f7a0504087034e18f2f /lib/Bytecode/Writer/Writer.cpp
parentd5c59d5c84d15976a555f0229f264d20852dc593 (diff)
downloadllvm-0baa0af86148200df4b7885e3b50855702f79b3a.tar.gz
llvm-0baa0af86148200df4b7885e3b50855702f79b3a.tar.bz2
llvm-0baa0af86148200df4b7885e3b50855702f79b3a.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--lib/Bytecode/Writer/Writer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index 5675b2af49..6467921d05 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/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);