15#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEREADER_H
16#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_BITCODEREADER_H
20#include "clang/AST/AST.h"
21#include "llvm/ADT/SmallVector.h"
22#include "llvm/Bitstream/BitstreamReader.h"
23#include "llvm/Support/Error.h"
35 llvm::Expected<std::vector<std::unique_ptr<Info>>>
readBitcode();
38 enum class Cursor { BadBlock = 1,
Record, BlockEnd, BlockBegin };
41 llvm::Error validateStream();
42 llvm::Error readVersion();
43 llvm::Error readBlockInfoBlock();
47 template <
typename T> llvm::Error readBlock(
unsigned ID, T I);
50 template <
typename T> llvm::Error readSubBlock(
unsigned ID, T I);
54 template <
typename T> llvm::Error readRecord(
unsigned ID, T I);
58 llvm::Expected<std::unique_ptr<Info>> createInfo(
unsigned ID);
62 Cursor skipUntilRecordOrBlock(
unsigned &BlockOrRecordID);
65 llvm::Expected<std::unique_ptr<Info>> readBlockToInfo(
unsigned ID);
67 llvm::BitstreamCursor &Stream;
68 std::optional<llvm::BitstreamBlockInfo> BlockInfo;
llvm::Expected< std::vector< std::unique_ptr< Info > > > readBitcode()
ClangDocBitcodeReader(llvm::BitstreamCursor &Stream)
llvm::SmallVector< uint64_t, 1024 > Record
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//