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'};
158 emitBlockInfoBlock();
183 class AbbreviationMap {
184 llvm::DenseMap<unsigned, unsigned> Abbrevs;
189 void add(
RecordId RID,
unsigned AbbrevID);
193 class StreamSubBlockGuard {
194 llvm::BitstreamWriter &Stream;
197 StreamSubBlockGuard(llvm::BitstreamWriter &Stream_,
BlockId ID)
204 StreamSubBlockGuard(
const StreamSubBlockGuard &) =
delete;
205 StreamSubBlockGuard &operator=(
const StreamSubBlockGuard &) =
delete;
207 ~StreamSubBlockGuard() { Stream.ExitBlock(); }
212 void emitVersionBlock();
215 void emitBlockInfoBlock();
216 void emitBlockInfo(
BlockId BID,
const std::vector<RecordId> &RIDs);
222 void emitRecord(
const Reference &Ref,
RecordId ID);
226 void emitRecord(
const TemplateInfo &Templ);
227 bool prepRecordData(
RecordId ID,
bool ShouldEmit =
true);
234 SmallVector<uint32_t, BitCodeConstants::RecordSize> Record;
235 llvm::BitstreamWriter &Stream;
236 AbbreviationMap Abbrevs;
void emitBlock(const NamespaceInfo &I)
ClangDocBitcodeWriter(llvm::BitstreamWriter &Stream)
bool dispatchInfoForWrite(Info *I)
@ TEMPLATE_SPECIALIZATION_OF
@ TEMPLATE_PARAM_CONTENTS
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