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'};
71 #define INFORECORDS(X) X##_USR, X##_NAME 124 emitBlockInfoBlock();
129 bool dispatchInfoForWrite(
Info *I);
143 class AbbreviationMap {
144 llvm::DenseMap<unsigned, unsigned> Abbrevs;
147 AbbreviationMap() : Abbrevs(RecordIdCount) {}
149 void add(
RecordId RID,
unsigned AbbrevID);
153 class StreamSubBlockGuard {
154 llvm::BitstreamWriter &Stream;
157 StreamSubBlockGuard(llvm::BitstreamWriter &Stream_,
BlockId ID)
164 StreamSubBlockGuard() =
default;
165 StreamSubBlockGuard(
const StreamSubBlockGuard &) =
delete;
166 StreamSubBlockGuard &operator=(
const StreamSubBlockGuard &) =
delete;
168 ~StreamSubBlockGuard() { Stream.ExitBlock(); }
173 void emitVersionBlock();
176 void emitBlockInfoBlock();
177 void emitBlockInfo(
BlockId BID,
const std::vector<RecordId> &RIDs);
180 void emitRecord(StringRef Str,
RecordId ID);
184 void emitRecord(
bool Value,
RecordId ID);
185 void emitRecord(
int Value,
RecordId ID);
186 void emitRecord(
unsigned Value,
RecordId ID);
187 bool prepRecordData(
RecordId ID,
bool ShouldEmit =
true);
194 SmallVector<uint32_t, BitCodeConstants::RecordSize>
Record;
195 llvm::BitstreamWriter &Stream;
196 AbbreviationMap Abbrevs;
202 #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