Go to the documentation of this file.
39 DbiModuleDescriptorBuilder::DbiModuleDescriptorBuilder(
StringRef ModuleName,
42 : MSF(Msf), ModuleName(
std::
string(ModuleName)) {
43 ::memset(&Layout, 0,
sizeof(Layout));
44 Layout.
Mod = ModIndex;
54 ObjFileName = std::string(
Name);
74 if (BulkSymbols.
empty())
77 Symbols.push_back(BulkSymbols);
81 "Invalid Symbol alignment!");
82 SymbolByteSize += BulkSymbols.
size();
85 void DbiModuleDescriptorBuilder::addSourceFile(
StringRef Path) {
86 SourceFiles.push_back(std::string(Path));
89 uint32_t DbiModuleDescriptorBuilder::calculateC13DebugInfoSize()
const {
91 for (
const auto &
Builder : C13Builders) {
92 Result +=
Builder.calculateSerializedLength();
108 Layout.
C13Bytes = calculateC13DebugInfoSize();
111 Layout.
NumFiles = SourceFiles.size();
123 uint32_t C13Size = calculateC13DebugInfoSize();
124 if (!C13Size && !SymbolByteSize)
129 return ExpectedSN.takeError();
149 auto NS = WritableMappedBlockStream::createIndexedStream(
162 "Invalid debug section alignment!");
164 for (
const auto &
Builder : C13Builders) {
165 if (
auto EC =
Builder.commit(SymbolWriter, CodeViewContainer::Pdb))
179 std::shared_ptr<DebugSubsection> Subsection) {
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This class represents lattice values for constants.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
void addSymbolsInBulk(ArrayRef< uint8_t > BulkSymbols)
Provides write only access to a subclass of WritableBinaryStream.
static ErrorSuccess success()
Create a success value.
const uint16_t kInvalidStreamIndex
uint32_t calculateSerializedLength() const
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.
bool empty() const
empty - Check if the array is empty.
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
@ Ref
The access may reference the value stored in memory.
uint32_t bytesRemaining() const
uint32_t getOffset() const
void setFirstSectionContrib(const SectionContrib &SC)
void setObjFileName(StringRef Name)
void addDebugSubsection(std::shared_ptr< codeview::DebugSubsection > Subsection)
uint32_t alignOf(CodeViewContainer Container)
uint32_t getNextSymbolOffset() const
Return the offset within the module symbol stream of the next symbol record passed to addSymbol.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Error writeCString(StringRef Str)
Write the string Str to the underlying stream followed by a null terminator.
void addSymbol(codeview::CVSymbol Symbol)
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.
StringRef - Represent a constant reference to a string, i.e.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
uint16_t getStreamIndex() const
BumpPtrAllocator & getAllocator()
Error padToAlignment(uint32_t Align)
Lightweight error class with error context and mandatory checking.
Error commit(BinaryStreamWriter &ModiWriter, const msf::MSFLayout &MsfLayout, WritableBinaryStreamRef MsfBuffer)
static uint32_t calculateDiSymbolStreamSize(uint32_t SymbolByteSize, uint32_t C13Size)
size_t size() const
size - Get the array size.
Error finalizeMsfLayout()
void setPdbFilePathNI(uint32_t NI)
~DbiModuleDescriptorBuilder()