llvm/clang-tools-extra/clang-doc/BitcodeWriter.cpp

//===--  BitcodeWriter.cpp - ClangDoc Bitcode Writer ------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "BitcodeWriter.h"
#include "llvm/ADT/IndexedMap.h"
#include <initializer_list>

namespace clang {
namespace doc {

// Empty SymbolID for comparison, so we don't have to construct one every time.
static const SymbolID EmptySID =;

// Since id enums are not zero-indexed, we need to transform the given id into
// its associated index.
struct BlockIdToIndexFunctor {};

struct RecordIdToIndexFunctor {};

AbbrevDsc;

static void AbbrevGen(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev,
                      const std::initializer_list<llvm::BitCodeAbbrevOp> Ops) {}

static void BoolAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {}

static void IntAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {}

static void SymbolIDAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {}

static void StringAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {}

// Assumes that the file will not have more than 65535 lines.
static void LocationAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {}

struct RecordIdDsc {};

static const llvm::IndexedMap<llvm::StringRef, BlockIdToIndexFunctor>
    BlockIdNameMap =::IndexedMap<llvm::StringRef, BlockIdToIndexFunctor> BlockIdNameMap;
      BlockIdNameMap.resize(BlockIdCount);

      // There is no init-list constructor for the IndexedMap, so have to
      // improvise
      static const std::vector<std::pair<BlockId, const char *const>> Inits =const auto &Init : Inits)
        BlockIdNameMap[Init.first] =;

static const llvm::IndexedMap<RecordIdDsc, RecordIdToIndexFunctor>
    RecordIdNameMap =::IndexedMap<RecordIdDsc, RecordIdToIndexFunctor> RecordIdNameMap;
      RecordIdNameMap.resize(RecordIdCount);

      // There is no init-list constructor for the IndexedMap, so have to
      // improvise
      static const std::vector<std::pair<RecordId, RecordIdDsc>> Inits =const auto &Init : Inits) {}
      assert(RecordIdNameMap.size() == RecordIdCount);
      return RecordIdNameMap;
    }();

static const std::vector<std::pair<BlockId, std::vector<RecordId>>>
    RecordsByBlock{};

// AbbreviationMap

constexpr unsigned char BitCodeConstants::Signature[];

void ClangDocBitcodeWriter::AbbreviationMap::add(RecordId RID,
                                                 unsigned AbbrevID) {}

unsigned ClangDocBitcodeWriter::AbbreviationMap::get(RecordId RID) const {}

// Validation and Overview Blocks

/// Emits the magic number header to check that its the right format,
/// in this case, 'DOCS'.
void ClangDocBitcodeWriter::emitHeader() {}

void ClangDocBitcodeWriter::emitVersionBlock() {}

/// Emits a block ID and the block name to the BLOCKINFO block.
void ClangDocBitcodeWriter::emitBlockID(BlockId BID) {}

/// Emits a record name to the BLOCKINFO block.
void ClangDocBitcodeWriter::emitRecordID(RecordId ID) {}

// Abbreviations

void ClangDocBitcodeWriter::emitAbbrev(RecordId ID, BlockId Block) {}

// Records

void ClangDocBitcodeWriter::emitRecord(const SymbolID &Sym, RecordId ID) {}

void ClangDocBitcodeWriter::emitRecord(llvm::StringRef Str, RecordId ID) {}

void ClangDocBitcodeWriter::emitRecord(const Location &Loc, RecordId ID) {}

void ClangDocBitcodeWriter::emitRecord(bool Val, RecordId ID) {}

void ClangDocBitcodeWriter::emitRecord(int Val, RecordId ID) {}

void ClangDocBitcodeWriter::emitRecord(unsigned Val, RecordId ID) {}

void ClangDocBitcodeWriter::emitRecord(const TemplateInfo &Templ) {}

bool ClangDocBitcodeWriter::prepRecordData(RecordId ID, bool ShouldEmit) {}

// BlockInfo Block

void ClangDocBitcodeWriter::emitBlockInfoBlock() {}

void ClangDocBitcodeWriter::emitBlockInfo(BlockId BID,
                                          const std::vector<RecordId> &RIDs) {}

// Block emission

void ClangDocBitcodeWriter::emitBlock(const Reference &R, FieldId Field) {}

void ClangDocBitcodeWriter::emitBlock(const TypeInfo &T) {}

void ClangDocBitcodeWriter::emitBlock(const TypedefInfo &T) {}

void ClangDocBitcodeWriter::emitBlock(const FieldTypeInfo &T) {}

void ClangDocBitcodeWriter::emitBlock(const MemberTypeInfo &T) {}

void ClangDocBitcodeWriter::emitBlock(const CommentInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const NamespaceInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const EnumInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const EnumValueInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const RecordInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const BaseRecordInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const FunctionInfo &I) {}

void ClangDocBitcodeWriter::emitBlock(const TemplateInfo &T) {}

void ClangDocBitcodeWriter::emitBlock(const TemplateSpecializationInfo &T) {}

void ClangDocBitcodeWriter::emitBlock(const TemplateParamInfo &T) {}

bool ClangDocBitcodeWriter::dispatchInfoForWrite(Info *I) {}

} // namespace doc
} // namespace clang