35 MAB.getTargetOptions().getABIName()));
40 std::unique_ptr<MCAsmBackend> MAB,
41 std::unique_ptr<MCObjectWriter> MOW,
42 std::unique_ptr<MCCodeEmitter> MCE)
60void RISCVTargetELFStreamer::emitAttribute(
unsigned Attribute,
unsigned Value) {
64void RISCVTargetELFStreamer::emitTextAttribute(
unsigned Attribute,
69void RISCVTargetELFStreamer::emitIntTextAttribute(
unsigned Attribute,
76void RISCVTargetELFStreamer::finishAttributeSection() {
90 unsigned EFlags = W.getELFHeaderEFlags();
117 W.setELFHeaderEFlags(EFlags);
120void RISCVTargetELFStreamer::reset() {
121 AttributeSection =
nullptr;
129void RISCVELFStreamer::reset() {
132 LastMappingSymbols.clear();
136void RISCVELFStreamer::emitDataMappingSymbol() {
137 if (LastEMS == EMS_Data)
139 emitMappingSymbol(
"$d");
143void RISCVELFStreamer::emitInstructionsMappingSymbol() {
144 if (LastEMS == EMS_Instructions)
146 emitMappingSymbol(
"$x");
147 LastEMS = EMS_Instructions;
163 LastEMS = LastMappingSymbols.lookup(Section);
170 emitInstructionsMappingSymbol();
175 emitDataMappingSymbol();
181 emitDataMappingSymbol();
187 emitDataMappingSymbol();
192 std::unique_ptr<MCAsmBackend> &&MAB,
193 std::unique_ptr<MCObjectWriter> &&MOW,
194 std::unique_ptr<MCCodeEmitter> &&MCE) {
Container class for subtarget features.
MCAsmBackend & getBackend() const
LLVM_ABI bool registerSymbol(const MCSymbol &Symbol)
Context object for machine code objects.
LLVM_ABI MCSymbol * createLocalSymbol(StringRef Name)
Create a local, non-temporary symbol like an ELF mapping symbol.
SmallVector< AttributeItem, 64 > Contents
void emitAttributesSection(StringRef Vendor, const Twine &Section, unsigned Type, MCSection *&AttributeSection)
void changeSection(MCSection *Section, uint32_t Subsection=0) override
This is called by popSection and switchSection, if the current section changes.
void setAttributeItems(unsigned Attribute, unsigned IntValue, StringRef StringValue, bool OverwriteExisting)
ELFObjectWriter & getWriter()
void setAttributeItem(unsigned Attribute, unsigned Value, bool OverwriteExisting)
void reset() override
state management
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.
Instances of this class represent a single low-level machine instruction.
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override
Emit Size bytes worth of the value specified by FillValue.
MCAssembler & getAssembler()
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
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.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
MCSectionSubPair getPreviousSection() const
Return the previous section that the streamer is emitting code to.
MCContext & getContext() const
MCTargetStreamer * getTargetStreamer()
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
const FeatureBitset & getFeatureBits() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void changeSection(MCSection *Section, uint32_t Subsection) override
This is called by popSection and switchSection, if the current section changes.
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
RISCVELFStreamer(MCContext &C, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > MOW, std::unique_ptr< MCCodeEmitter > MCE)
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) override
Emit Size bytes worth of the value specified by FillValue.
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.
void emitDirectiveOptionExact() override
void emitDirectiveOptionPop() override
void emitDirectiveOptionPush() override
void emitDirectiveOptionNoPIC() override
void emitDirectiveOptionNoRVC() override
void emitDirectiveOptionNoExact() 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 setFlagsFromFeatures(const MCSubtargetInfo &STI)
void setTargetABI(RISCVABI::ABI ABI)
Represents a location in source code.
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
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, const FeatureBitset &FeatureBits, StringRef ABIName)
This is an optimization pass for GlobalISel generic memory operations.
MCStreamer * createRISCVELFStreamer(const Triple &, MCContext &C, std::unique_ptr< MCAsmBackend > &&MAB, std::unique_ptr< MCObjectWriter > &&MOW, std::unique_ptr< MCCodeEmitter > &&MCE)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.