[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamWriter.h LLVMBitCodes.h
Chris Lattner
sabre at nondot.org
Mon Apr 23 13:35:03 PDT 2007
Changes in directory llvm/include/llvm/Bitcode:
BitstreamWriter.h updated: 1.5 -> 1.6
LLVMBitCodes.h updated: 1.1 -> 1.2
---
Log message:
Fix a bug in bitstream writer handling abbrevs, add value symtab
---
Diffs of the changes: (+12 -6)
BitstreamWriter.h | 11 ++++++-----
LLVMBitCodes.h | 7 ++++++-
2 files changed, 12 insertions(+), 6 deletions(-)
Index: llvm/include/llvm/Bitcode/BitstreamWriter.h
diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.5 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.6
--- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.5 Mon Apr 23 13:57:32 2007
+++ llvm/include/llvm/Bitcode/BitstreamWriter.h Mon Apr 23 15:34:46 2007
@@ -147,12 +147,8 @@
EmitVBR(CodeLen, bitc::CodeLenWidth);
FlushToWord();
BlockScope.push_back(Block(CurCodeSize, Out.size()/4));
-
- // Delete all abbrevs.
- for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
- delete CurAbbrevs[i];
-
BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
+
// Emit a placeholder, which will be replaced when the block is popped.
Emit(0, bitc::BlockSizeWidth);
@@ -161,6 +157,11 @@
void ExitBlock() {
assert(!BlockScope.empty() && "Block scope imbalance!");
+
+ // Delete all abbrevs.
+ for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
+ delete CurAbbrevs[i];
+
const Block &B = BlockScope.back();
// Block tail:
Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h
diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.1 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.2
--- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.1 Sun Apr 22 20:01:15 2007
+++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Mon Apr 23 15:34:46 2007
@@ -33,7 +33,7 @@
GLOBALCONSTANTS_BLOCK_ID = 3,
FUNCTION_BLOCK_ID = 4,
TYPE_SYMTAB_BLOCK_ID = 5,
- GLOBAL_SYMTAB_BLOCK_ID = 6
+ VALUE_SYMTAB_BLOCK_ID = 6
};
@@ -81,6 +81,11 @@
TST_ENTRY_CODE = 1 // TST_ENTRY: [typeid, namelen, namechar x N]
};
+ // The value symbol table only has one code (VST_ENTRY_CODE).
+ enum ValueSymtabCodes {
+ VST_ENTRY_CODE = 1 // VST_ENTRY: [valid, namelen, namechar x N]
+ };
+
} // End bitc namespace
} // End llvm namespace
More information about the llvm-commits
mailing list