17void SPIRVObjectWriter::writeHeader(
const MCAssembler &Asm) {
20 constexpr uint32_t GeneratorMagicNumber =
21 (GeneratorID << 16) | (LLVM_VERSION_MAJOR);
25 W.
write<
uint32_t>((VersionInfo.Major << 16) | (VersionInfo.Minor << 8));
33 VersionInfo.Major = Major;
34 VersionInfo.Minor = Minor;
35 VersionInfo.Bound = Bound;
42 Asm.writeSectionData(W.
OS, &S);
43 return W.
OS.
tell() - StartOffset;
46std::unique_ptr<MCObjectWriter>
49 return std::make_unique<SPIRVObjectWriter>(std::move(MOTW),
OS);
Instances of this class represent a uniqued identifier for a section in the current translation unit.
void setBuildVersion(unsigned Major, unsigned Minor, unsigned Bound)
uint64_t tell() const
tell - Return the current offset with the file.
An abstract base class for streams implementations that also support a pwrite operation.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectWriter > createSPIRVObjectWriter(std::unique_ptr< MCSPIRVObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new SPIR-V writer instance.
void write(ArrayRef< value_type > Val)