Go to the documentation of this file.
40 std::unique_ptr<MCAsmBackend> MAB,
41 std::unique_ptr<MCObjectWriter> OW,
42 std::unique_ptr<MCCodeEmitter> Emitter)
46 void PPCELFStreamer::emitPrefixedInstruction(
const MCInst &Inst,
71 if (LastLabel && !LastLabel->
isUnset() && LastLabelLoc.
isValid() &&
79 if (InstLine == LabelLine) {
101 if (IsPartOfGOTToPCRelPair && !*IsPartOfGOTToPCRelPair)
102 emitGOTToPCRelReloc(Inst);
109 emitPrefixedInstruction(Inst, STI);
116 if (IsPartOfGOTToPCRelPair && *IsPartOfGOTToPCRelPair)
117 emitGOTToPCRelLabel(Inst);
137 void 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(
172 void PPCELFStreamer::emitGOTToPCRelLabel(
const MCInst &Inst) {
180 "Expecting a symbol of type VK_PPC_PCREL_OPT");
224 std::unique_ptr<MCObjectWriter> OW,
225 std::unique_ptr<MCCodeEmitter> Emitter) {
VariantKind getKind() const
bool isPrefixedInstruction(const MCInst &MI) const
This is an optimization pass for GlobalISel generic memory operations.
void setOffset(uint64_t Value)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static Lanai::Fixups FixupKind(const MCExpr *Expr)
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Context object for machine code objects.
uint64_t getOffset() const
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
MCFragment * getFragment(bool SetUsed=true) const
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
Instances of this class represent a single low-level machine instruction.
unsigned getNumOperands() const
@ FirstLiteralRelocationKind
The range [FirstLiteralRelocationKind, MaxTargetFixupKind) is used for relocations coming from ....
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Represents a location in source code.
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
const MCSymbol & getSymbol() const
MCCodeEmitter * getEmitterPtr() const
PPCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
StringRef getName() const
getName - Get the symbol name.
MCFragment * getCurrentFragment() const
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Represent a reference to a symbol from inside an expression.
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
MCAssembler & getAssembler()
MCELFStreamer * createPPCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
const MCExpr * getExpr() const
unsigned getOpcode() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Optional< bool > isPartOfGOTToPCRelPair(const MCInst &Inst, const MCSubtargetInfo &STI)
MCFixupKind
Extensible enumeration to represent the type of a fixup.
MCContext & getContext() const
void assignFragment(MCSymbol *Symbol, MCFragment *Fragment)
Sets the symbol's section.
const SourceMgr * getSourceManager() const
const MCOperand & getOperand(unsigned i) const
Instances of this class represent operands of the MCInst class.
void emitCodeAlignment(unsigned ByteAlignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
Fragment for data and encoded instructions.
Generic base class for all target subtargets.
Base class for the full range of assembler expressions which are needed for parsing.
unsigned FindLineNumber(SMLoc Loc, unsigned BufferID=0) const
Find the line number for the specified location in the specified file.