33 Size +=
alignTo(SymbolByteSize, 4);
41 DbiModuleDescriptorBuilder::DbiModuleDescriptorBuilder(
StringRef ModuleName,
44 : MSF(Msf), ModuleName(ModuleName) {
45 ::memset(&Layout, 0,
sizeof(Layout));
46 Layout.
Mod = ModIndex;
69 Symbols.push_back(Symbol);
73 "Invalid Symbol alignment!");
74 SymbolByteSize += Symbol.
length();
77 void DbiModuleDescriptorBuilder::addSourceFile(
StringRef Path) {
78 SourceFiles.push_back(Path);
81 uint32_t DbiModuleDescriptorBuilder::calculateC13DebugInfoSize()
const {
83 for (
const auto &Builder : C13Builders) {
84 assert(Builder &&
"Empty C13 Fragment Builder!");
85 Result += Builder->calculateSerializedLength();
102 Layout.
C13Bytes = calculateC13DebugInfoSize();
105 Layout.
NumFiles = SourceFiles.size();
116 uint32_t C13Size = calculateC13DebugInfoSize();
120 return ExpectedSN.takeError();
140 auto NS = WritableMappedBlockStream::createIndexedStream(
157 "Invalid debug section alignment!");
158 for (
const auto &Builder : C13Builders) {
159 assert(Builder &&
"Empty C13 Fragment Builder!");
160 if (
auto EC = Builder->commit(SymbolWriter))
174 std::shared_ptr<DebugSubsection> Subsection) {
176 C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
177 std::move(Subsection), CodeViewContainer::Pdb));
182 C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
183 SubsectionContents, CodeViewContainer::Pdb));
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
Compute iterated dominance frontiers using a linear time algorithm.
Error commit(BinaryStreamWriter &ModiWriter, const msf::MSFLayout &MsfLayout, WritableBinaryStreamRef MsfBuffer)
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
~DbiModuleDescriptorBuilder()
Error finalizeMsfLayout()
uint32_t alignOf(CodeViewContainer Container)
The access may reference the value stored in memory.
void setFirstSectionContrib(const SectionContrib &SC)
void setObjFileName(StringRef Name)
const uint16_t kInvalidStreamIndex
support::ulittle16_t Imod
uint32_t getOffset() const
Error writeStreamRef(BinaryStreamRef Ref)
Efficiently reads all data from Ref, and writes it to this stream.
Provides write only access to a subclass of WritableBinaryStream.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
uint32_t bytesRemaining() const
Error writeCString(StringRef Str)
Write the string Str to the underlying stream followed by a null terminator.
static ErrorSuccess success()
Create a success value.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
CHAIN = SC CHAIN, Imm128 - System call.
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 uint32_t calculateDiSymbolStreamSize(uint32_t SymbolByteSize, uint32_t C13Size)
uint16_t getStreamIndex() const
void addSymbol(codeview::CVSymbol Symbol)
Error padToAlignment(uint32_t Align)
uint32_t calculateSerializedLength() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
BinaryItemStream represents a sequence of objects stored in some kind of external container but for w...
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Lightweight error class with error context and mandatory checking.
void setItems(ArrayRef< T > ItemArray)
StringRef - Represent a constant reference to a string, i.e.
void setPdbFilePathNI(uint32_t NI)
BumpPtrAllocator & getAllocator()
void addDebugSubsection(std::shared_ptr< codeview::DebugSubsection > Subsection)