Defines the object file and target independent interfaces used by the assembler backend to write native file format object files.

Synopsis

Declared in <llvm/MC/MCObjectWriter.h>

class MCObjectWriter;

Description

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().

Member Functions

Name

Description

MCObjectWriter [constructor] [deleted]

Deleted copy constructor.

~MCObjectWriter [destructor] [virtual]

Destroy the object writer.

operator= [deleted]

Deleted copy assignment operator.

addAddrsigSymbol

Record the given symbol in the address‐significance table to be written diring writeObject().

addFileName

Append a declared input file name.

emitAddrsigSection

Request emission of an address‐significance table.

executePostLayoutBinding [virtual]

Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations).

getAddrsigSyms

Return the symbols recorded for the address‐significance table.

getCGProfile

Return the call‐graph profile entries to emit.

getContext

Get the MC context associated with the assembler.

getEmitAddrsigSection

Return whether an address‐significance section will be emitted.

getFileNames

Return the list of declared input file names.

getSubsectionsViaSymbols

Return whether Mach‐O .subsections_via_symbols is enabled.

isSymbolRefDifferenceFullyResolved

Check whether the difference (A ‐ B) between two symbol references is fully resolved.

isSymbolRefDifferenceFullyResolvedImpl [virtual]

Implementation hook for isSymbolRefDifferenceFullyResolved.

recordRelocation [virtual]

Record a relocation entry.

reset [virtual]

lifetime management

setAssembler [virtual]

Set the assembler that owns this object writer.

setCompilerVersion

Set the optional compiler version string (XCOFF).

setSubsectionsViaSymbols

Enable or disable Mach‐O .subsections_via_symbols.

writeObject [virtual]

Write the object file and returns the number of bytes written.

Protected Types

Name

Description

CGProfileEntry

One call‐graph profile edge with a from/to pair and edge weight.

Protected Member Functions

Name

Description

MCObjectWriter [constructor]

Construct an object writer with default state.

Protected Data Members

Name

Description

AddrsigSyms

Symbols to record in the address‐significance table.

Asm

Assembler that owns this object writer, or null if unset.

CGProfile

Accumulated call‐graph profile edges to emit.

CompilerVersion

Optional compiler version string (XCOFF‐specific).

EmitAddrsigSection

True if an address‐significance section should be emitted.

FileNames

List of declared file names

SubsectionsViaSymbols

True if Mach‐O .subsections_via_symbols is enabled.

Non-Member Functions

Name

Description

createGOFFObjectWriter

Construct a new GOFF writer instance.

createGOFFObjectWriter

Construct a new GOFF writer instance with a split‐DWARF stream.

createSPIRVObjectWriter

Construct a new SPIR‐V writer instance.

createWasmDwoObjectWriter

Construct a new Wasm writer that emits split DWARF to a separate stream.

createWasmObjectWriter

Construct a new Wasm writer instance.

createWinCOFFDwoObjectWriter

Construct a new Win COFF writer instance with a split‐DWARF stream.

createWinCOFFObjectWriter

Construct a new Win COFF writer instance.

createXCOFFObjectWriter

Construct a new XCOFF writer instance.

Derived Classes

Name

Description

DXContainerObjectWriter

DXContainer object writer that emits DXContainer files from an MCAssembler.

ELFObjectWriter

ELF object writer that emits ELF object files from an MCAssembler.

GOFFObjectWriter

GOFF object writer that emits GOFF object files from an MCAssembler.

MachObjectWriter

Mach‐O object writer that emits Mach‐O object files from an MCAssembler.

SPIRVObjectWriter

SPIR‐V object writer that emits SPIR‐V object files from an MCAssembler.

WinCOFFObjectWriter

Win COFF object writer that emits COFF object files from an MCAssembler.

XCOFFObjectWriter

XCOFF object writer that emits XCOFF object files from an MCAssembler.

Created with MrDocs