39 std::unique_ptr<MCAsmBackend> MAB,
40 std::unique_ptr<MCObjectWriter> OW,
41 std::unique_ptr<MCCodeEmitter>
Emitter)
45void PPCELFStreamer::emitPrefixedInstruction(
const MCInst &Inst,
70 if (LastLabel && !LastLabel->
isUnset() && LastLabelLoc.
isValid() &&
78 if (InstLine == LabelLine) {
94 std::optional<bool> IsPartOfGOTToPCRelPair =
101 if (IsPartOfGOTToPCRelPair && !*IsPartOfGOTToPCRelPair)
102 emitGOTToPCRelReloc(Inst);
105 if (!
Emitter->isPrefixedInstruction(Inst)) {
109 emitPrefixedInstruction(Inst, STI);
116 if (IsPartOfGOTToPCRelPair && *IsPartOfGOTToPCRelPair)
117 emitGOTToPCRelLabel(Inst);
137void PPCELFStreamer::emitGOTToPCRelReloc(
const MCInst &Inst) {
145 "Expecting a symbol of type VK_PPC_PCREL_OPT");
154 const MCExpr *CurrentLocationExpr =
161 assert(
DF &&
"Expecting a valid data fragment.");
163 ELF::R_PPC64_PCREL_OPT);
164 DF->getFixups().push_back(
166 FixupKind, Inst.
getLoc()));
172void PPCELFStreamer::emitGOTToPCRelLabel(
const MCInst &Inst) {
180 "Expecting a symbol of type VK_PPC_PCREL_OPT");
224 MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
225 std::unique_ptr<MCObjectWriter> OW,
226 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.
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
MCFragment * getCurrentFragment() const
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 setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
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.
constexpr bool isValid() const
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)
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.