]> granicus.if.org Git - clang/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/cfe/trunk@285660 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/Serialization/ASTWriter.cpp
lib/Serialization/GlobalModuleIndex.cpp

index 6c8d6184cb35ab64bd7c51cab34184bd5ad1d460..1ea5a342e1d83a0ab1f1a75e811bada7bd962b15 100644 (file)
@@ -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;
index 211d111fe04fe8a2553ef4cb04bd8b61bcffc1ab..e34347d206417a6e2534be01089095a5b3754ed4 100644 (file)
@@ -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)
index 581e894d915063c41d64c4c503299d9cde6b4558..f75bc5260cc293f1d876de51c03675fa020a8364 100644 (file)
@@ -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)