From 24b28107475c076a13f35bf496efcd161a6f2354 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 1 Nov 2016 01:18:57 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285660 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/SerializedDiagnosticPrinter.cpp | 2 +- lib/Serialization/ASTWriter.cpp | 2 +- lib/Serialization/GlobalModuleIndex.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Frontend/SerializedDiagnosticPrinter.cpp b/lib/Frontend/SerializedDiagnosticPrinter.cpp index 6c8d6184cb..1ea5a342e1 100644 --- a/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/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/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 211d111fe0..e34347d206 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/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/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp index 581e894d91..f75bc5260c 100644 --- a/lib/Serialization/GlobalModuleIndex.cpp +++ b/lib/Serialization/GlobalModuleIndex.cpp @@ -460,7 +460,7 @@ static void emitRecordID(unsigned ID, const char *Name, void GlobalModuleIndexBuilder::emitBlockInfoBlock(llvm::BitstreamWriter &Stream) { SmallVector 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) -- 2.40.0