15#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H
16#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEWRITER_H
19#include "clang/AST/AST.h"
20#include "llvm/ADT/DenseMap.h"
21#include "llvm/ADT/SmallVector.h"
22#include "llvm/ADT/StringRef.h"
23#include "llvm/Bitstream/BitstreamWriter.h"
24#include <initializer_list>
47 static constexpr unsigned char Signature[4] = {
'D',
'O',
'C',
'S'};
184 emitBlockInfoBlock();
213 class AbbreviationMap {
214 llvm::DenseMap<unsigned, unsigned> Abbrevs;
219 void add(
RecordId RID,
unsigned AbbrevID);
223 class StreamSubBlockGuard {
224 llvm::BitstreamWriter &Stream;
227 StreamSubBlockGuard(llvm::BitstreamWriter &Stream_,
BlockId ID)
234 StreamSubBlockGuard(
const StreamSubBlockGuard &) =
delete;
235 StreamSubBlockGuard &operator=(
const StreamSubBlockGuard &) =
delete;
237 ~StreamSubBlockGuard() { Stream.ExitBlock(); }
242 void emitVersionBlock();
245 void emitBlockInfoBlock();
246 void emitBlockInfo(
BlockId BID,
const std::vector<RecordId> &RIDs);
249 void emitRecord(StringRef Str,
RecordId ID);
251 void emitRecord(
const Location &Loc,
RecordId ID);
252 void emitRecord(
const Reference &Ref,
RecordId ID);
253 void emitRecord(
bool Value,
RecordId ID);
254 void emitRecord(
int Value,
RecordId ID);
255 void emitRecord(
unsigned Value,
RecordId ID);
256 void emitRecord(
const TemplateInfo &Templ);
257 bool prepRecordData(
RecordId ID,
bool ShouldEmit =
true);
264 SmallVector<uint32_t, BitCodeConstants::RecordSize> Record;
265 llvm::BitstreamWriter &Stream;
266 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 char Signature[4]
static constexpr unsigned RecordSize
static constexpr int USRHashSize
static constexpr unsigned StringLengthSize
static constexpr unsigned USRBitLengthSize
static constexpr unsigned IntSize
static constexpr unsigned SignatureBitSize
static constexpr unsigned SubblockIDSize
static constexpr unsigned USRLengthSize
static constexpr unsigned ReferenceTypeSize