39 MAB.getTargetOptions().getABIName()));
55void RISCVTargetELFStreamer::emitAttribute(
unsigned Attribute,
unsigned Value) {
59void RISCVTargetELFStreamer::emitTextAttribute(
unsigned Attribute,
64void RISCVTargetELFStreamer::emitIntTextAttribute(
unsigned Attribute,
71void RISCVTargetELFStreamer::finishAttributeSection() {
88 if (Features[RISCV::FeatureStdExtC])
90 if (Features[RISCV::FeatureStdExtZtso])
116void RISCVTargetELFStreamer::reset() {
117 AttributeSection =
nullptr;
127 const auto *MBE = dyn_cast<MCBinaryExpr>(
Value);
132 if (!
Value->evaluateAsRelocatable(
E,
nullptr,
nullptr))
134 if (
E.getSymA() ==
nullptr ||
E.getSymB() ==
nullptr)
137 const auto &
A =
E.getSymA()->getSymbol();
138 const auto &
B =
E.getSymB()->getSymbol();
155 if (
A.isInSection() &&
A.getSection().getKind().isText())
157 if (
B.isInSection() &&
B.getSection().getKind().isText())
167 if (!
A.isInSection() && !
A.isTemporary() &&
B.isInSection())
171 return A.isInSection() &&
B.isInSection() &&
172 A.getSection().getName() !=
B.getSection().getName();
175void RISCVELFStreamer::reset() {
183 if (!requiresFixups(getContext(),
Value,
A,
B))
189 flushPendingLabels(
DF,
DF->getContents().size());
195 DF->getFixups().push_back(
197 DF->getFixups().push_back(
200 DF->getContents().resize(
DF->getContents().size() +
Size, 0);
205 std::unique_ptr<MCAsmBackend> MAB,
206 std::unique_ptr<MCObjectWriter> MOW,
207 std::unique_ptr<MCCodeEmitter> MCE,
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override
Emit the expression Value into the output as a native integer of the given Size bytes.
Container class for subtarget features.
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
unsigned getELFHeaderEFlags() const
ELF e_header flags.
MCAsmBackend & getBackend() const
void setELFHeaderEFlags(unsigned Flags)
void setRelaxAll(bool Value)
static const MCBinaryExpr * create(Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
Fragment for data and encoded instructions.
static void make(MCStreamer *MCOS, MCSection *Section)
SmallVector< AttributeItem, 64 > Contents
void emitAttributesSection(StringRef Vendor, const Twine &Section, unsigned Type, MCSection *&AttributeSection)
void setAttributeItems(unsigned Attribute, unsigned IntValue, StringRef StringValue, bool OverwriteExisting)
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
void setAttributeItem(unsigned Attribute, unsigned Value, bool OverwriteExisting)
void reset() override
state management
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())
MCAssembler & getAssembler()
Streaming machine code generation interface.
virtual void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
const FeatureBitset & getFeatureBits() const
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 ...
This represents an "assembler immediate".
void emitDirectiveOptionPop() override
void emitDirectiveOptionPush() override
void emitDirectiveOptionNoPIC() override
void emitDirectiveOptionNoRVC() override
RISCVTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
void emitDirectiveVariantCC(MCSymbol &Symbol) override
void emitDirectiveOptionRelax() override
RISCVELFStreamer & getStreamer()
void emitDirectiveOptionNoRelax() override
void emitDirectiveOptionPIC() override
void emitDirectiveOptionRVC() override
RISCVABI::ABI getTargetABI() const
void setTargetABI(RISCVABI::ABI ABI)
Represents a location in source code.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
@ EF_RISCV_FLOAT_ABI_SINGLE
@ EF_RISCV_FLOAT_ABI_DOUBLE
ABI computeTargetABI(const Triple &TT, FeatureBitset FeatureBits, StringRef ABIName)
static std::pair< MCFixupKind, MCFixupKind > getRelocPairForSize(unsigned Size)
This is an optimization pass for GlobalISel generic memory operations.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
MCELFStreamer * createRISCVELFStreamer(MCContext &C, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > MOW, std::unique_ptr< MCCodeEmitter > MCE, bool RelaxAll)