class SPIRVObjectWriter

Declaration

class SPIRVObjectWriter : public MCObjectWriter { /* full declaration omitted */ };

Description

Defines the object file and target independent interfaces used by the assembler backend to write native file format object files. The object writer contains a few callbacks used by the assembler to allow the object writer to modify the assembler data structures at appropriate points. Once assembly is complete, the object writer is given the MCAssembler instance, which contains all the symbol and section data which should be emitted as part of writeObject().

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:17

Inherits from: MCObjectWriter

Member Variables

private ::support::endian::Writer W
private std::unique_ptr<MCSPIRVObjectTargetWriter> TargetObjectWriter
The target specific SPIR-V writer instance.

Inherited from MCObjectWriter:

protected AddrsigSyms
protected EmitAddrsigSection = false

Method Overview

  • public SPIRVObjectWriter(std::unique_ptr<MCSPIRVObjectTargetWriter> MOTW, llvm::raw_pwrite_stream & OS)
  • private void executePostLayoutBinding(llvm::MCAssembler & Asm, const llvm::MCAsmLayout & Layout)
  • private void recordRelocation(llvm::MCAssembler & Asm, const llvm::MCAsmLayout & Layout, const llvm::MCFragment * Fragment, const llvm::MCFixup & Fixup, llvm::MCValue Target, uint64_t & FixedValue)
  • private void writeHeader(const llvm::MCAssembler & Asm)
  • private uint64_t writeObject(llvm::MCAssembler & Asm, const llvm::MCAsmLayout & Layout)
  • public ~SPIRVObjectWriter()

Inherited from MCObjectWriter:

Methods

SPIRVObjectWriter(
    std::unique_ptr<MCSPIRVObjectTargetWriter>
        MOTW,
    llvm::raw_pwrite_stream& OS)

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:24

Parameters

std::unique_ptr<MCSPIRVObjectTargetWriter> MOTW
llvm::raw_pwrite_stream& OS

void executePostLayoutBinding(
    llvm::MCAssembler& Asm,
    const llvm::MCAsmLayout& Layout)

Description

Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations). This routine is called by the assembler after layout and relaxation is complete.

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:35

Parameters

llvm::MCAssembler& Asm
const llvm::MCAsmLayout& Layout

void recordRelocation(
    llvm::MCAssembler& Asm,
    const llvm::MCAsmLayout& Layout,
    const llvm::MCFragment* Fragment,
    const llvm::MCFixup& Fixup,
    llvm::MCValue Target,
    uint64_t& FixedValue)

Description

Record a relocation entry. This routine is called by the assembler after layout and relaxation, and post layout binding. The implementation is responsible for storing information about the relocation so that it can be emitted during writeObject().

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:31

Parameters

llvm::MCAssembler& Asm
const llvm::MCAsmLayout& Layout
const llvm::MCFragment* Fragment
const llvm::MCFixup& Fixup
llvm::MCValue Target
uint64_t& FixedValue

void writeHeader(const llvm::MCAssembler& Asm)

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:39

Parameters

const llvm::MCAssembler& Asm

uint64_t writeObject(
    llvm::MCAssembler& Asm,
    const llvm::MCAsmLayout& Layout)

Description

Write the object file and returns the number of bytes written. This routine is called by the assembler after layout and relaxation is complete, fixups have been evaluated and applied, and relocations generated.

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:38

Parameters

llvm::MCAssembler& Asm
const llvm::MCAsmLayout& Layout

~SPIRVObjectWriter()

Declared at: llvm/lib/MC/SPIRVObjectWriter.cpp:28