]> granicus.if.org Git - llvm/commitdiff
Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 1 Nov 2016 01:18:57 +0000 (01:18 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 1 Nov 2016 01:18:57 +0000 (01:18 +0000)
No block info block should need to define local abbreviations, so we can
always use a code width of 2.

Also change all block info block writers to use EnterBlockInfoBlock.

Differential Revision: https://reviews.llvm.org/D26168

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

include/llvm/Bitcode/BitstreamWriter.h
lib/Bitcode/Writer/BitcodeWriter.cpp

index d613f5e1895464fe612f31f54f4c79e9413925e0..707b2105c1698b771332b77666359b2517712e7f 100644 (file)
@@ -506,8 +506,8 @@ public:
   //===--------------------------------------------------------------------===//
 
   /// EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.
-  void EnterBlockInfoBlock(unsigned CodeWidth) {
-    EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, CodeWidth);
+  void EnterBlockInfoBlock() {
+    EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, 2);
     BlockInfoCurBID = ~0U;
   }
 private:
index bea54ca1444e578aeda2bde1df6750d6040dab20..ac1c18b49a7f4164bb789140acfd7f0ad2dc05d3 100644 (file)
@@ -3031,7 +3031,7 @@ void ModuleBitcodeWriter::writeBlockInfo() {
   // We only want to emit block info records for blocks that have multiple
   // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK.
   // Other blocks can define their abbrevs inline.
-  Stream.EnterBlockInfoBlock(2);
+  Stream.EnterBlockInfoBlock();
 
   { // 8-bit fixed-width VST_CODE_ENTRY/VST_CODE_BBENTRY strings.
     BitCodeAbbrev *Abbv = new BitCodeAbbrev();