16 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H 17 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H 20 #include "clang/AST/AST.h" 21 #include "llvm/ADT/DenseMap.h" 22 #include "llvm/ADT/SmallVector.h" 23 #include "llvm/ADT/StringRef.h" 24 #include "llvm/Bitcode/BitstreamWriter.h" 25 #include <initializer_list> 48 static constexpr
char Signature[4] = {
'D',
'O',
'C',
'S'};
132 emitBlockInfoBlock();
137 bool dispatchInfoForWrite(
Info *I);
151 class AbbreviationMap {
152 llvm::DenseMap<unsigned, unsigned> Abbrevs;
155 AbbreviationMap() : Abbrevs(RecordIdCount) {}
157 void add(
RecordId RID,
unsigned AbbrevID);
161 class StreamSubBlockGuard {
162 llvm::BitstreamWriter &Stream;
165 StreamSubBlockGuard(llvm::BitstreamWriter &Stream_,
BlockId ID)
172 StreamSubBlockGuard(
const StreamSubBlockGuard &) =
delete;
173 StreamSubBlockGuard &operator=(
const StreamSubBlockGuard &) =
delete;
175 ~StreamSubBlockGuard() { Stream.ExitBlock(); }
180 void emitVersionBlock();
183 void emitBlockInfoBlock();
184 void emitBlockInfo(
BlockId BID,
const std::vector<RecordId> &RIDs);
187 void emitRecord(StringRef Str,
RecordId ID);
191 void emitRecord(
bool Value,
RecordId ID);
192 void emitRecord(
int Value,
RecordId ID);
193 void emitRecord(
unsigned Value,
RecordId ID);
194 bool prepRecordData(
RecordId ID,
bool ShouldEmit =
true);
201 SmallVector<uint32_t, BitCodeConstants::RecordSize>
Record;
202 llvm::BitstreamWriter &Stream;
203 AbbreviationMap Abbrevs;
209 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H SourceLocation Loc
'#' location in the include directive
static constexpr unsigned SignatureBitSize
static const unsigned VersionNumber
static constexpr unsigned SubblockIDSize
static constexpr unsigned BlockIdCount
ClangDocBitcodeWriter(llvm::BitstreamWriter &Stream)
llvm::SmallVector< uint64_t, 1024 > Record
static constexpr unsigned BoolSize
static constexpr unsigned LineNumberSize
static constexpr char Signature[4]
static constexpr unsigned RecordSize
static constexpr int USRHashSize
static constexpr unsigned ReferenceTypeSize
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static constexpr unsigned IntSize
static constexpr unsigned USRBitLengthSize
static constexpr unsigned USRLengthSize
static constexpr unsigned StringLengthSize
std::array< uint8_t, 20 > SymbolID
static constexpr unsigned FilenameLengthSize
static constexpr unsigned RecordIdCount