47 ::memset(&Layout, 0,
sizeof(Layout));
48 Layout.
Mod = ModIndex;
58 ObjFileName = std::string(
Name);
78 if (BulkSymbols.
empty())
85 "Invalid Symbol alignment!");
86 SymbolByteSize += BulkSymbols.
size();
97 "Invalid Symbol alignment!");
98 SymbolByteSize += SymLength;
101void DbiModuleDescriptorBuilder::addSourceFile(
StringRef Path) {
105uint32_t DbiModuleDescriptorBuilder::calculateC13DebugInfoSize()
const {
107 for (
const auto &Builder : C13Builders) {
108 Result += Builder.calculateSerializedLength();
116 uint32_t O = ObjFileName.size() + 1;
124 Layout.
C13Bytes = calculateC13DebugInfoSize();
139 uint32_t C13Size = calculateC13DebugInfoSize();
140 if (!C13Size && !SymbolByteSize)
145 return ExpectedSN.takeError();
177 if (
Sym.NeedsToBeMerged) {
178 assert(MergeSymsCallback);
179 if (
auto EC = MergeSymsCallback(MergeSymsCtx,
Sym.SymPtr, SymbolWriter))
188 auto SavedOffset = SymbolWriter.
getOffset();
197 "Invalid debug section alignment!");
199 for (
const auto &Builder : C13Builders) {
200 if (
auto EC = Builder.commit(SymbolWriter, CodeViewContainer::Pdb))
214 std::shared_ptr<DebugSubsection> Subsection) {
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static uint32_t calculateDiSymbolStreamSize(uint32_t SymbolByteSize, uint32_t C13Size)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
Provides write only access to a subclass of WritableBinaryStream.
Error writeCString(StringRef Str)
Write the string Str to the underlying stream followed by a null terminator.
uint64_t getOffset() const
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
uint64_t bytesRemaining() const
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
void setOffset(uint64_t Off)
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
Error padToAlignment(uint32_t Align)
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
StringRef - Represent a constant reference to a string, i.e.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
BumpPtrAllocator & getAllocator()
Expected< uint32_t > addStream(uint32_t Size, ArrayRef< uint32_t > Blocks)
Add a stream to the MSF file with the given size, occupying the given list of blocks.
static std::unique_ptr< WritableMappedBlockStream > createIndexedStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
void addUnmergedSymbols(void *SymSrc, uint32_t SymLength)
void setObjFileName(StringRef Name)
void addDebugSubsection(std::shared_ptr< codeview::DebugSubsection > Subsection)
~DbiModuleDescriptorBuilder()
void setFirstSectionContrib(const SectionContrib &SC)
Error finalizeMsfLayout()
uint16_t getStreamIndex() const
void addSymbol(codeview::CVSymbol Symbol)
void setPdbFilePathNI(uint32_t NI)
Error commitSymbolStream(const msf::MSFLayout &MsfLayout, WritableBinaryStreamRef MsfBuffer)
Commit the accumulated symbols to the module symbol stream.
Error commit(BinaryStreamWriter &ModiWriter)
Commit the DBI descriptor to the DBI stream.
uint32_t getNextSymbolOffset() const
Return the offset within the module symbol stream of the next symbol record passed to addSymbol.
void addSymbolsInBulk(ArrayRef< uint8_t > BulkSymbols)
DbiModuleDescriptorBuilder(StringRef ModuleName, uint32_t ModIndex, msf::MSFBuilder &Msf)
uint32_t calculateSerializedLength() const
uint32_t alignOf(CodeViewContainer Container)
const uint16_t kInvalidStreamIndex
This is an optimization pass for GlobalISel generic memory operations.
@ Ref
The access may reference the value stored in memory.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Implement std::hash so that hash_code can be used in STL containers.
Represents a string table reference at some offset in the module symbol stream.