#include "llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h"
#include "llvm/DebugInfo/CodeView/RecordName.h"
#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
#include "llvm/DebugInfo/MSF/MSFBuilder.h"
#include "llvm/DebugInfo/MSF/MSFCommon.h"
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
#include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
#include "llvm/DebugInfo/PDB/Native/Hash.h"
#include "llvm/DebugInfo/PDB/Native/RawTypes.h"
#include "llvm/Support/BinaryItemStream.h"
#include "llvm/Support/BinaryStreamWriter.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/xxhash.h"
#include <algorithm>
#include <vector>
usingnamespacellvm;
usingnamespacellvm::msf;
usingnamespacellvm::pdb;
usingnamespacellvm::codeview;
struct llvm::pdb::GSIHashStreamBuilder { … };
struct llvm::pdb::SymbolDenseMapInfo { … };
namespace {
LLVM_PACKED_START
struct PublicSym32Layout { … };
LLVM_PACKED_END
}
static uint32_t sizeOfPublic(const BulkPublic &Pub) { … }
static CVSymbol serializePublic(uint8_t *Mem, const BulkPublic &Pub) { … }
uint32_t GSIHashStreamBuilder::calculateSerializedLength() const { … }
Error GSIHashStreamBuilder::commit(BinaryStreamWriter &Writer) { … }
static bool isAsciiString(StringRef S) { … }
static int gsiRecordCmp(StringRef S1, StringRef S2) { … }
void GSIStreamBuilder::finalizePublicBuckets() { … }
void GSIStreamBuilder::finalizeGlobalBuckets(uint32_t RecordZeroOffset) { … }
void GSIHashStreamBuilder::finalizeBuckets(
uint32_t RecordZeroOffset, MutableArrayRef<BulkPublic> Records) { … }
GSIStreamBuilder::GSIStreamBuilder(msf::MSFBuilder &Msf)
: … { … }
GSIStreamBuilder::~GSIStreamBuilder() = default;
uint32_t GSIStreamBuilder::calculatePublicsHashStreamSize() const { … }
uint32_t GSIStreamBuilder::calculateGlobalsHashStreamSize() const { … }
Error GSIStreamBuilder::finalizeMsfLayout() { … }
void GSIStreamBuilder::addPublicSymbols(std::vector<BulkPublic> &&PublicsIn) { … }
void GSIStreamBuilder::addGlobalSymbol(const ProcRefSym &Sym) { … }
void GSIStreamBuilder::addGlobalSymbol(const DataSym &Sym) { … }
void GSIStreamBuilder::addGlobalSymbol(const ConstantSym &Sym) { … }
template <typename T>
void GSIStreamBuilder::serializeAndAddGlobal(const T &Symbol) { … }
void GSIStreamBuilder::addGlobalSymbol(const codeview::CVSymbol &Symbol) { … }
static Error writePublics(BinaryStreamWriter &Writer,
ArrayRef<BulkPublic> Publics) { … }
static Error writeRecords(BinaryStreamWriter &Writer,
ArrayRef<CVSymbol> Records) { … }
Error GSIStreamBuilder::commitSymbolRecordStream(
WritableBinaryStreamRef Stream) { … }
static std::vector<support::ulittle32_t>
computeAddrMap(ArrayRef<BulkPublic> Publics) { … }
Error GSIStreamBuilder::commitPublicsHashStream(
WritableBinaryStreamRef Stream) { … }
Error GSIStreamBuilder::commitGlobalsHashStream(
WritableBinaryStreamRef Stream) { … }
Error GSIStreamBuilder::commit(const msf::MSFLayout &Layout,
WritableBinaryStreamRef Buffer) { … }