34 assert(SectionSize < std::numeric_limits<uint32_t>::max() &&
35 "Section size too large for DXContainer");
42 if (Sec.getName() ==
"DXIL")
45 assert(PartOffset < std::numeric_limits<uint32_t>::max() &&
46 "Part data too large for DXContainer");
50 uint64_t FileSize = PartStart + PartOffset;
51 assert(FileSize < std::numeric_limits<uint32_t>::max() &&
52 "File size too large for DXContainer");
55 W.
write<
char>({
'D',
'X',
'B',
'C'});
75 unsigned Start = W.
OS.
tell();
81 if (Sec.getName() ==
"DXIL")
86 if (Sec.getName() ==
"DXIL") {
97 if (TT.hasEnvironment())
103 memcpy(Header.Bitcode.Magic,
"DXIL", 4);
105 Header.Bitcode.MajorVersion = DXILVersion.
getMajor();
106 Header.Bitcode.MinorVersion = DXILVersion.
getMinor().value_or(0);
108 Header.Bitcode.Size = SectionSize;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
uint64_t writeObject() override
Write the object file and returns the number of bytes written.
LLVM_ABI uint64_t getSectionAddressSize(const MCSection &Sec) const
LLVM_ABI void writeSectionData(raw_ostream &OS, const MCSection *Section) const
Emit the section contents to OS.
const Triple & getTargetTriple() const
virtual ~MCDXContainerTargetWriter()
MCContext & getContext() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Triple - Helper class for working with autoconf configuration names.
Represents a version number in the form major[.minor[.subminor[.build]]].
unsigned getMajor() const
Retrieve the major version number.
std::optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
uint64_t tell() const
tell - Return the current offset with the file.
constexpr bool IsBigEndianHost
This is an optimization pass for GlobalISel generic memory operations.
uint64_t offsetToAlignment(uint64_t Value, Align Alignment)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This struct is a compact representation of a valid (non-zero power of two) alignment.
void write(ArrayRef< value_type > Val)