Use the SymbolTable::isEmpty() method instead of checking for no value
authorReid Spencer <rspencer@reidspencer.com>
Thu, 27 May 2004 20:18:51 +0000 (20:18 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Thu, 27 May 2004 20:18:51 +0000 (20:18 +0000)
planes. A SymbolTable could still have types in it! This fixes problems
with two regression tests that failed because a symbol table that only
contained types was being omitted from bytecode files. Thanks to Chris
for the reduced test case that helped find this immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13842 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Writer/Writer.cpp

index d139a6f309830b378de3b9886193d28af1f870bd..5b6fdd79004b996bd1d10dd9de4841913485c5c0 100644 (file)
@@ -307,7 +307,7 @@ void BytecodeWriter::outputCompactionTable() {
 void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) {
   // Do not output the Bytecode block for an empty symbol table, it just wastes
   // space!
-  if (MST.plane_begin() == MST.plane_end()) return;
+  if ( MST.isEmpty() ) return;
 
   BytecodeBlock SymTabBlock(BytecodeFormat::SymbolTable, Out,
                             true/* ElideIfEmpty*/);