40 std::unique_ptr<MCAsmBackend> MAB,
41 std::unique_ptr<MCObjectWriter> OW,
42 std::unique_ptr<MCCodeEmitter>
Emitter)
46void PPCELFStreamer::emitPrefixedInstruction(
const MCInst &Inst,
71 if (LastLabel && !LastLabel->
isUnset() && LastLabelLoc.
isValid() &&
79 if (InstLine == LabelLine) {
95 std::optional<bool> IsPartOfGOTToPCRelPair =
102 if (IsPartOfGOTToPCRelPair && !*IsPartOfGOTToPCRelPair)
103 emitGOTToPCRelReloc(Inst);
106 if (!
Emitter->isPrefixedInstruction(Inst)) {
110 emitPrefixedInstruction(Inst, STI);
117 if (IsPartOfGOTToPCRelPair && *IsPartOfGOTToPCRelPair)
118 emitGOTToPCRelLabel(Inst);
138void PPCELFStreamer::emitGOTToPCRelReloc(
const MCInst &Inst) {
146 "Expecting a symbol of type VK_PPC_PCREL_OPT");
155 const MCExpr *CurrentLocationExpr =
162 assert(
DF &&
"Expecting a valid data fragment.");
164 ELF::R_PPC64_PCREL_OPT);
165 DF->getFixups().push_back(
167 FixupKind, Inst.
getLoc()));
173void PPCELFStreamer::emitGOTToPCRelLabel(
const MCInst &Inst) {
181 "Expecting a symbol of type VK_PPC_PCREL_OPT");
225 MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
226 std::unique_ptr<MCObjectWriter> OW,
227 std::unique_ptr<MCCodeEmitter>
Emitter) {
dxil DXContainer Global Emitter
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCCodeEmitter * getEmitterPtr() const
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
const SourceMgr * getSourceManager() const
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Fragment for data and encoded instructions.
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Base class for the full range of assembler expressions which are needed for parsing.
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.
unsigned getNumOperands() const
unsigned getOpcode() const
const MCOperand & getOperand(unsigned i) const
MCAssembler & getAssembler()
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
MCFragment * getCurrentFragment() const
void emitCodeAlignment(Align ByteAlignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
Instances of this class represent operands of the MCInst class.
const MCExpr * getExpr() const
void assignFragment(MCSymbol *Symbol, MCFragment *Fragment)
Sets the symbol's section.
MCContext & getContext() const
Generic base class for all target subtargets.
Represent a reference to a symbol from inside an expression.
const MCSymbol & getSymbol() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
VariantKind getKind() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef getName() const
getName - Get the symbol name.
void setOffset(uint64_t Value)
uint64_t getOffset() const
MCFragment * getFragment(bool SetUsed=true) const
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
PPCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Represents a location in source code.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
unsigned FindLineNumber(SMLoc Loc, unsigned BufferID=0) const
Find the line number for the specified location in the specified file.
This is an optimization pass for GlobalISel generic memory operations.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
@ FirstLiteralRelocationKind
The range [FirstLiteralRelocationKind, MaxTargetFixupKind) is used for relocations coming from ....
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
MCELFStreamer * createPPCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
std::optional< bool > isPartOfGOTToPCRelPair(const MCInst &Inst, const MCSubtargetInfo &STI)
This struct is a compact representation of a valid (non-zero power of two) alignment.