36 std::unique_ptr<MCAsmBackend> MAB,
37 std::unique_ptr<MCObjectWriter> OW,
38 std::unique_ptr<MCCodeEmitter>
Emitter)
42void PPCELFStreamer::emitPrefixedInstruction(
const MCInst &Inst,
67 if (LastLabel && !LastLabel->
isUnset() && LastLabelLoc.
isValid() &&
75 if (InstLine == LabelLine) {
91 std::optional<bool> IsPartOfGOTToPCRelPair =
98 if (IsPartOfGOTToPCRelPair && !*IsPartOfGOTToPCRelPair)
99 emitGOTToPCRelReloc(Inst);
102 if (!
Emitter->isPrefixedInstruction(Inst)) {
106 emitPrefixedInstruction(Inst, STI);
113 if (IsPartOfGOTToPCRelPair && *IsPartOfGOTToPCRelPair)
114 emitGOTToPCRelLabel(Inst);
134void PPCELFStreamer::emitGOTToPCRelReloc(
const MCInst &Inst) {
142 "Expecting a symbol of type VK_PPC_PCREL_OPT");
151 const MCExpr *CurrentLocationExpr =
158 assert(
DF &&
"Expecting a valid data fragment.");
160 ELF::R_PPC64_PCREL_OPT);
161 DF->getFixups().push_back(
163 FixupKind, Inst.
getLoc()));
169void PPCELFStreamer::emitGOTToPCRelLabel(
const MCInst &Inst) {
177 "Expecting a symbol of type VK_PPC_PCREL_OPT");
221 MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
222 std::unique_ptr<MCObjectWriter> OW,
223 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.