Prevent an empty compaction table from being written to the bytecode file.

llvm-svn: 16063
This commit is contained in:
Reid Spencer 2004-08-27 00:38:44 +00:00
parent 3b789ad2b8
commit 248c06dcea
1 changed files with 12 additions and 8 deletions

View File

@ -1034,15 +1034,19 @@ void BytecodeWriter::outputCompactionTypes(unsigned StartNo) {
}
void BytecodeWriter::outputCompactionTable() {
// Avoid writing the compaction table at all if there is no content.
if (Table.getCompactionTypes().size() >= Type::FirstDerivedTyID ||
(!Table.CompactionTableIsEmpty())) {
BytecodeBlock CTB(BytecodeFormat::CompactionTableBlockID, *this,
true/*ElideIfEmpty*/);
const std::vector<std::vector<const Value*> > &CT =Table.getCompactionTable();
// First thing is first, emit the type compaction table if there is one.
// First things first, emit the type compaction table if there is one.
outputCompactionTypes(Type::FirstDerivedTyID);
for (unsigned i = 0, e = CT.size(); i != e; ++i)
outputCompactionTablePlane(i, CT[i], 0);
}
}
void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) {