28 std::unique_ptr<MCAsmBackend> MAB,
29 std::unique_ptr<MCObjectWriter> OW,
30 std::unique_ptr<MCCodeEmitter>
Emitter)
36 auto *Symbol = cast<MCSymbolXCOFF>(
Sym);
47 Symbol->setExternal(
true);
51 Symbol->setExternal(
true);
55 Symbol->setExternal(
true);
89 std::optional<MCFixupKind> MaybeKind =
96 DF->getFixups().push_back(
Fixup);
101 unsigned Lang,
unsigned Reason,
102 unsigned FunctionSize,
105 FunctionSize, hasDebug);
109 Align ByteAlignment) {
111 Symbol->setExternal(cast<MCSymbolXCOFF>(Symbol)->getStorageClass() !=
113 Symbol->setCommon(
Size, ByteAlignment);
117 cast<MCSymbolXCOFF>(Symbol)->getRepresentedCsect()->setAlignment(
140 const size_t ContentsSize =
DF->getContents().size();
141 auto &DataFragmentFixups =
DF->getFixups();
142 for (
auto &
Fixup : Fixups) {
143 Fixup.setOffset(
Fixup.getOffset() + ContentsSize);
144 DataFragmentFixups.push_back(
Fixup);
147 DF->setHasInstructions(STI);
148 DF->getContents().append(Code.begin(), Code.end());
152 std::unique_ptr<MCAsmBackend> &&MAB,
153 std::unique_ptr<MCObjectWriter> &&OW,
154 std::unique_ptr<MCCodeEmitter> &&CE,
157 std::move(OW), std::move(CE));
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)
void setRelaxAll(bool Value)
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
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()
virtual void addExceptionEntry(const MCSymbol *Symbol, const MCSymbol *Trap, unsigned LanguageCode, unsigned ReasonCode, unsigned FunctionSize, bool hasDebug)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
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.
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 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.
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.
MCStreamer * createXCOFFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
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.
This struct is a compact representation of a valid (non-zero power of two) alignment.