diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-17 23:25:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-17 23:25:43 +0000 |
commit | 677af4a1cbc3e300bcb84cacb76ed7618b128ada (patch) | |
tree | 06537551d3e0492cd0b2c89d5b16e319d8eee6cc /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | 4533ba592b0e3e0bf26e62a2afa4a6f62a1c2394 (diff) | |
download | bcm5719-llvm-677af4a1cbc3e300bcb84cacb76ed7618b128ada.tar.gz bcm5719-llvm-677af4a1cbc3e300bcb84cacb76ed7618b128ada.zip |
Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes. This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.
llvm-svn: 10908
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 6467921d053..ff9e8a989b1 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -161,6 +161,11 @@ void BytecodeWriter::outputConstantsInPlane(const std::vector<const Value*> } } +static inline bool hasNullValue(unsigned TyID) { + return TyID != Type::LabelTyID && TyID != Type::TypeTyID && + TyID != Type::VoidTyID; +} + void BytecodeWriter::outputConstants(bool isFunction) { ConstantTotalBytes -= Out.size(); if (isFunction) FunctionConstantTotalBytes -= Out.size(); @@ -190,7 +195,7 @@ void BytecodeWriter::outputConstants(bool isFunction) { if (isFunction) // Don't re-emit module constants ValNo += Table.getModuleLevel(pno); - if (pno >= Type::FirstDerivedTyID) { + if (hasNullValue(pno)) { // Skip zero initializer if (ValNo == 0) ValNo = 1; |