29 std::unique_ptr<MCAsmBackend> MAB,
30 std::unique_ptr<MCObjectWriter> OW,
31 std::unique_ptr<MCCodeEmitter>
Emitter)
41 auto *Symbol = cast<MCSymbolXCOFF>(
Sym);
52 Symbol->setExternal(
true);
56 Symbol->setExternal(
true);
60 Symbol->setExternal(
true);
94 std::optional<MCFixupKind> MaybeKind =
101 DF->getFixups().push_back(
Fixup);
107 if (!Symbol->hasRename())
113 unsigned Lang,
unsigned Reason,
114 unsigned FunctionSize,
125 Align ByteAlignment) {
127 Symbol->setExternal(cast<MCSymbolXCOFF>(Symbol)->getStorageClass() !=
129 Symbol->setCommon(
Size, ByteAlignment);
133 cast<MCSymbolXCOFF>(Symbol)->getRepresentedCsect()->setAlignment(
156 const size_t ContentsSize =
DF->getContents().size();
157 auto &DataFragmentFixups =
DF->getFixups();
158 for (
auto &
Fixup : Fixups) {
159 Fixup.setOffset(
Fixup.getOffset() + ContentsSize);
160 DataFragmentFixups.push_back(
Fixup);
163 DF->setHasInstructions(STI);
164 DF->getContents().append(Code.begin(), Code.end());
dxil DXContainer Global Emitter
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
PowerPC TLS Dynamic Call Fixup
virtual std::optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
MCObjectWriter & getWriter() const
MCCodeEmitter & getEmitter() const
MCAsmBackend & getBackend() const
bool registerSymbol(const MCSymbol &Symbol)
virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
Encode the given Inst to bytes and append to CB.
Context object for machine code objects.
Fragment for data and encoded instructions.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
Instances of this class represent a single low-level machine instruction.
Streaming object file generation interface.
void emitValueToAlignment(Align Alignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
MCDataFragment * getOrCreateDataFragment(const MCSubtargetInfo *STI=nullptr)
Get a data fragment to write into, creating a new one if the current fragment is not a data fragment.
MCAssembler & getAssembler()
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCContext & getContext() const
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Generic base class for all target subtargets.
Represent a reference to a symbol from inside an expression.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment) override
Emit a common symbol.
XCOFFObjectWriter & getWriter()
void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, MCSymbol *CsectSym, Align Alignment) override
Emits an lcomm directive with XCOFF csect information.
void emitZerofill(MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, Align ByteAlignment=Align(1), SMLoc Loc=SMLoc()) override
Emit the zerofill section and an optional symbol.
void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override
void emitXCOFFRefDirective(const MCSymbol *Symbol) override
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more sy...
MCXCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
void emitXCOFFExceptDirective(const MCSymbol *Symbol, const MCSymbol *Trap, unsigned Lang, unsigned Reason, unsigned FunctionSize, bool hasDebug) override
Emit an XCOFF .except directive which adds information about a trap instruction to the object file ex...
void emitXCOFFRenameDirective(const MCSymbol *Name, StringRef Rename) override
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name.
void emitXCOFFCInfoSym(StringRef Name, StringRef Metadata) override
Emit a C_INFO symbol with XCOFF embedded metadata to the .info section.
void emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol, MCSymbolAttr Linkage, MCSymbolAttr Visibility) override
Emit a symbol's linkage and visibility with a linkage directive for XCOFF.
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
Represents a location in source code.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
virtual void addExceptionEntry(const MCSymbol *Symbol, const MCSymbol *Trap, unsigned LanguageCode, unsigned ReasonCode, unsigned FunctionSize, bool hasDebug)=0
virtual void addCInfoSymEntry(StringRef Name, StringRef Metadata)=0
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
@ MCSA_Protected
.protected (ELF)
@ MCSA_Exported
.globl _foo, exported (XCOFF)
@ MCSA_Global
.type _foo, @gnu_unique_object
@ MCSA_Extern
.extern (XCOFF)
@ MCSA_Hidden
.hidden (ELF)
@ MCSA_LGlobal
.lglobl (XCOFF)
@ MCSA_Invalid
Not a valid directive.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.