diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-01 01:18:57 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-01 01:18:57 +0000 |
| commit | d3a6c70b2dd6bfa5b0dbd21a38987749a326899f (patch) | |
| tree | 1eb86bd51516f3268e20ef1bfa28259b5291cf5c | |
| parent | f3dd863031ddc75cab9abdf2d6dc21da58d1b622 (diff) | |
| download | bcm5719-llvm-d3a6c70b2dd6bfa5b0dbd21a38987749a326899f.tar.gz bcm5719-llvm-d3a6c70b2dd6bfa5b0dbd21a38987749a326899f.zip | |
Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.
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
llvm-svn: 285660
| -rw-r--r-- | clang/lib/Frontend/SerializedDiagnosticPrinter.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 2 | ||||
| -rw-r--r-- | llvm/include/llvm/Bitcode/BitstreamWriter.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp index 6c8d6184cb3..1ea5a342e1d 100644 --- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -436,7 +436,7 @@ static void AddRangeLocationAbbrev(llvm::BitCodeAbbrev *Abbrev) { } void SDiagsWriter::EmitBlockInfoBlock() { - State->Stream.EnterBlockInfoBlock(3); + State->Stream.EnterBlockInfoBlock(); using namespace llvm; llvm::BitstreamWriter &Stream = State->Stream; diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 211d111fe04..e34347d2064 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -991,7 +991,7 @@ static void AddStmtsExprs(llvm::BitstreamWriter &Stream, void ASTWriter::WriteBlockInfoBlock() { RecordData Record; - Stream.EnterSubblock(llvm::bitc::BLOCKINFO_BLOCK_ID, 3); + Stream.EnterBlockInfoBlock(); #define BLOCK(X) EmitBlockID(X ## _ID, #X, Stream, Record) #define RECORD(X) EmitRecordID(X, #X, Stream, Record) diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 581e894d915..f75bc5260cc 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -460,7 +460,7 @@ static void emitRecordID(unsigned ID, const char *Name, void GlobalModuleIndexBuilder::emitBlockInfoBlock(llvm::BitstreamWriter &Stream) { SmallVector<uint64_t, 64> Record; - Stream.EnterSubblock(llvm::bitc::BLOCKINFO_BLOCK_ID, 3); + Stream.EnterBlockInfoBlock(); #define BLOCK(X) emitBlockID(X ## _ID, #X, Stream, Record) #define RECORD(X) emitRecordID(X, #X, Stream, Record) diff --git a/llvm/include/llvm/Bitcode/BitstreamWriter.h b/llvm/include/llvm/Bitcode/BitstreamWriter.h index d613f5e1895..707b2105c16 100644 --- a/llvm/include/llvm/Bitcode/BitstreamWriter.h +++ b/llvm/include/llvm/Bitcode/BitstreamWriter.h @@ -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: diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index bea54ca1444..ac1c18b49a7 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -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(); |

