32 Size +=
alignTo(SymbolByteSize, 4);
40 DbiModuleDescriptorBuilder::DbiModuleDescriptorBuilder(
StringRef ModuleName,
43 : MSF(Msf), ModuleName(ModuleName) {
44 ::memset(&Layout, 0,
sizeof(Layout));
45 Layout.
Mod = ModIndex;
75 if (BulkSymbols.
empty())
78 Symbols.push_back(BulkSymbols);
82 "Invalid Symbol alignment!");
83 SymbolByteSize += BulkSymbols.
size();
86 void DbiModuleDescriptorBuilder::addSourceFile(
StringRef Path) {
87 SourceFiles.push_back(Path);
90 uint32_t DbiModuleDescriptorBuilder::calculateC13DebugInfoSize()
const {
92 for (
const auto &Builder : C13Builders) {
93 assert(Builder &&
"Empty C13 Fragment Builder!");
94 Result += Builder->calculateSerializedLength();
111 Layout.
C13Bytes = calculateC13DebugInfoSize();
114 Layout.
NumFiles = SourceFiles.size();
125 uint32_t C13Size = calculateC13DebugInfoSize();
129 return ExpectedSN.takeError();
149 auto NS = WritableMappedBlockStream::createIndexedStream(
162 "Invalid debug section alignment!");
164 for (
const auto &Builder : C13Builders) {
165 assert(Builder &&
"Empty C13 Fragment Builder!");
166 if (
auto EC = Builder->commit(SymbolWriter))
180 std::shared_ptr<DebugSubsection> Subsection) {
182 C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
183 std::move(Subsection), CodeViewContainer::Pdb));
188 C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
189 SubsectionContents, CodeViewContainer::Pdb));
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
This class represents lattice values for constants.
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)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
The access may reference the value stored in memory.
ArrayRef< uint8_t > data() const
void setFirstSectionContrib(const SectionContrib &SC)
void setObjFileName(StringRef Name)
const uint16_t kInvalidStreamIndex
support::ulittle16_t Imod
uint32_t getOffset() const
size_t size() const
size - Get the array size.
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.
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())
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
void setPdbFilePathNI(uint32_t NI)
void addSymbolsInBulk(ArrayRef< uint8_t > BulkSymbols)
BumpPtrAllocator & getAllocator()
bool empty() const
empty - Check if the array is empty.
void addDebugSubsection(std::shared_ptr< codeview::DebugSubsection > Subsection)