15#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H
16#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H
19#include "llvm/ADT/DenseMap.h"
20#include "llvm/Bitstream/BitstreamWriter.h"
43 static constexpr unsigned char Signature[4] = {
'D',
'O',
'C',
'S'};
180 emitBlockInfoBlock();
209 class AbbreviationMap {
210 llvm::DenseMap<unsigned, unsigned> Abbrevs;
215 void add(
RecordId RID,
unsigned AbbrevID);
219 class StreamSubBlockGuard {
220 llvm::BitstreamWriter &Stream;
223 StreamSubBlockGuard(llvm::BitstreamWriter &Stream_,
BlockId ID)
230 StreamSubBlockGuard(
const StreamSubBlockGuard &) =
delete;
231 StreamSubBlockGuard &operator=(
const StreamSubBlockGuard &) =
delete;
233 ~StreamSubBlockGuard() { Stream.ExitBlock(); }
238 void emitVersionBlock();
241 void emitBlockInfoBlock();
242 void emitBlockInfo(
BlockId BID,
const std::vector<RecordId> &RIDs);
245 void emitRecord(StringRef Str,
RecordId ID);
247 void emitRecord(
const Location &Loc,
RecordId ID);
248 void emitRecord(
const Reference &Ref,
RecordId ID);
249 void emitRecord(
bool Value,
RecordId ID);
250 void emitRecord(
int Value,
RecordId ID);
251 void emitRecord(
unsigned Value,
RecordId ID);
252 void emitRecord(
const TemplateInfo &Templ);
253 bool prepRecordData(
RecordId ID,
bool ShouldEmit =
true);
260 SmallVector<uint32_t, BitCodeConstants::RecordSize> Record;
261 llvm::BitstreamWriter &Stream;
262 AbbreviationMap Abbrevs;
void emitBlock(const NamespaceInfo &I)
ClangDocBitcodeWriter(llvm::BitstreamWriter &Stream)
bool dispatchInfoForWrite(Info *I)
@ TEMPLATE_SPECIALIZATION_OF
@ MEMBER_TYPE_IS_TEMPLATE
@ TEMPLATE_PARAM_CONTENTS
@ CONCEPT_CONSTRAINT_EXPRESSION
static constexpr unsigned BlockIdCount
static const unsigned VersionNumber
static constexpr unsigned RecordIdCount
std::array< uint8_t, 20 > SymbolID
@ BI_TEMPLATE_SPECIALIZATION_BLOCK_ID
@ BI_TEMPLATE_PARAM_BLOCK_ID
@ BI_MEMBER_TYPE_BLOCK_ID
@ BI_BASE_RECORD_BLOCK_ID
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static constexpr unsigned BoolSize
static constexpr unsigned LineNumberSize
static constexpr unsigned FilenameLengthSize
static constexpr unsigned RecordSize
static constexpr int USRHashSize
static constexpr unsigned StringLengthSize
static constexpr unsigned USRBitLengthSize
static constexpr unsigned char Signature[4]
static constexpr unsigned IntSize
static constexpr unsigned SignatureBitSize
static constexpr unsigned SubblockIDSize
static constexpr unsigned USRLengthSize
static constexpr unsigned ReferenceTypeSize