34 cl::desc(
"Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate"));
38 cl::desc(
"When generating R_RISCV_ALIGN, insert $alignment-2 "
39 "bytes of NOPs even in norvc code"));
42 bool Is64Bit,
bool IsLittleEndian,
51 if (
STI.getTargetTriple().isOSBinFormatELF()) {
54#define ELF_RELOC(NAME, ID) .Case(#NAME, ID)
55#include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
57#define ELF_RISCV_NONSTANDARD_RELOC(_VENDOR, NAME, ID) .Case(#NAME, ID)
58#include "llvm/BinaryFormat/ELFRelocs/RISCV_nonstandard.def"
59#undef ELF_RISCV_NONSTANDARD_RELOC
60 .
Case(
"BFD_RELOC_NONE", ELF::R_RISCV_NONE)
61 .
Case(
"BFD_RELOC_32", ELF::R_RISCV_32)
62 .
Case(
"BFD_RELOC_64", ELF::R_RISCV_64)
76 {
"fixup_riscv_hi20", 12, 20, 0},
77 {
"fixup_riscv_lo12_i", 20, 12, 0},
78 {
"fixup_riscv_12_i", 20, 12, 0},
79 {
"fixup_riscv_lo12_s", 0, 32, 0},
80 {
"fixup_riscv_pcrel_hi20", 12, 20, 0},
81 {
"fixup_riscv_pcrel_lo12_i", 20, 12, 0},
82 {
"fixup_riscv_pcrel_lo12_s", 0, 32, 0},
83 {
"fixup_riscv_jal", 12, 20, 0},
84 {
"fixup_riscv_branch", 0, 32, 0},
85 {
"fixup_riscv_rvc_jump", 2, 11, 0},
86 {
"fixup_riscv_rvc_branch", 0, 16, 0},
87 {
"fixup_riscv_rvc_imm", 0, 16, 0},
88 {
"fixup_riscv_call", 0, 64, 0},
89 {
"fixup_riscv_call_plt", 0, 64, 0},
91 {
"fixup_riscv_qc_e_branch", 0, 48, 0},
92 {
"fixup_riscv_qc_e_32", 16, 32, 0},
93 {
"fixup_riscv_qc_abs20_u", 0, 32, 0},
94 {
"fixup_riscv_qc_e_call_plt", 0, 48, 0},
97 {
"fixup_riscv_nds_branch_10", 0, 32, 0},
100 "Not all fixup kinds added to Infos array");
119 bool Resolved)
const {
121 auto Kind =
Fixup.getKind();
170 if (!STI.
hasFeature(RISCV::FeatureVendorXqcili))
180 return RISCV::QC_E_LI;
183 if (!STI.
hasFeature(RISCV::FeatureVendorXqcilb))
188 if (
Reg == RISCV::X0)
189 return RISCV::QC_E_J;
190 if (
Reg == RISCV::X1)
191 return RISCV::QC_E_JAL;
196 return RISCV::PseudoLongBEQ;
198 return RISCV::PseudoLongBNE;
200 return RISCV::PseudoLongBEQI;
202 return RISCV::PseudoLongBNEI;
204 return RISCV::PseudoLongBLT;
206 return RISCV::PseudoLongBGE;
208 return RISCV::PseudoLongBLTU;
210 return RISCV::PseudoLongBGEU;
212 return RISCV::PseudoLongQC_BEQI;
214 return RISCV::PseudoLongQC_BNEI;
216 return RISCV::PseudoLongQC_BLTI;
218 return RISCV::PseudoLongQC_BGEI;
219 case RISCV::QC_BLTUI:
220 return RISCV::PseudoLongQC_BLTUI;
221 case RISCV::QC_BGEUI:
222 return RISCV::PseudoLongQC_BGEUI;
223 case RISCV::QC_E_BEQI:
224 return RISCV::PseudoLongQC_E_BEQI;
225 case RISCV::QC_E_BNEI:
226 return RISCV::PseudoLongQC_E_BNEI;
227 case RISCV::QC_E_BLTI:
228 return RISCV::PseudoLongQC_E_BLTI;
229 case RISCV::QC_E_BGEI:
230 return RISCV::PseudoLongQC_E_BGEI;
231 case RISCV::QC_E_BLTUI:
232 return RISCV::PseudoLongQC_E_BLTUI;
233 case RISCV::QC_E_BGEUI:
234 return RISCV::PseudoLongQC_E_BGEUI;
243 if (
STI.hasFeature(RISCV::FeatureExactAssembly))
258 "Branch Relaxation Error");
264 assert(
STI.hasFeature(RISCV::FeatureVendorXqcilb) &&
265 "JAL is only relaxable with Xqcilb");
268 "JAL only relaxable with rd=x0 or rd=x1");
283 assert(
STI.hasFeature(RISCV::FeatureVendorXqcili) &&
284 "C.LI is only relaxable with Xqcili");
302 case RISCV::QC_BLTUI:
303 case RISCV::QC_BGEUI:
304 case RISCV::QC_E_BEQI:
305 case RISCV::QC_E_BNEI:
306 case RISCV::QC_E_BLTI:
307 case RISCV::QC_E_BGEI:
308 case RISCV::QC_E_BLTUI:
309 case RISCV::QC_E_BGEUI:
316 Inst = std::move(Res);
330 auto *Sec =
F.getParent();
331 if (
F.getLayoutOrder() <= Sec->firstLinkerRelaxable())
337 AlignRvc ||
STI->hasFeature(RISCV::FeatureStdExtZca) ? 2 : 4;
338 if (
F.getAlignment() <= MinNopLen)
341 Size =
F.getAlignment().value() - MinNopLen;
346 F.setLinkerRelaxable();
351 int64_t LineDelta =
F.getDwarfLineDelta();
352 const MCExpr &AddrDelta =
F.getDwarfAddrDelta();
356 if (AddrDelta.evaluateAsAbsolute(
Value, *
Asm))
358 [[maybe_unused]]
bool IsAbsolute =
360 assert(IsAbsolute &&
"CFA with invalid expression");
367 OS <<
uint8_t(dwarf::DW_LNS_advance_line);
378 <<
uint8_t(dwarf::DW_LNE_set_address);
382 OS <<
uint8_t(dwarf::DW_LNS_fixed_advance_pc);
388 OS <<
uint8_t(dwarf::DW_LNS_extended_op);
390 OS <<
uint8_t(dwarf::DW_LNE_end_sequence);
392 OS <<
uint8_t(dwarf::DW_LNS_copy);
395 F.setVarContents(
Data);
402 const MCExpr &AddrDelta =
F.getDwarfAddrDelta();
405 if (AddrDelta.evaluateAsAbsolute(
Value, *
Asm))
407 [[maybe_unused]]
bool IsAbsolute =
409 assert(IsAbsolute &&
"CFA with invalid expression");
412 "expected 1-byte alignment");
414 F.clearVarContents();
419 auto AddFixups = [&Fixups, &AddrDelta](
unsigned Offset,
420 std::pair<unsigned, unsigned>
Fixup) {
429 OS <<
uint8_t(dwarf::DW_CFA_advance_loc);
430 AddFixups(0, {ELF::R_RISCV_SET6, ELF::R_RISCV_SUB6});
432 OS <<
uint8_t(dwarf::DW_CFA_advance_loc1);
434 AddFixups(1, {ELF::R_RISCV_SET8, ELF::R_RISCV_SUB8});
436 OS <<
uint8_t(dwarf::DW_CFA_advance_loc2);
438 AddFixups(1, {ELF::R_RISCV_SET16, ELF::R_RISCV_SUB16});
440 OS <<
uint8_t(dwarf::DW_CFA_advance_loc4);
442 AddFixups(1, {ELF::R_RISCV_SET32, ELF::R_RISCV_SUB32});
446 F.setVarContents(
Data);
447 F.setVarFixups(Fixups);
452 int64_t &
Value)
const {
454 return std::make_pair(
false,
false);
468 if (
STI.hasFeature(RISCV::FeatureExactAssembly))
489 if (
Count % 4 == 2) {
492 OS.
write(
"\x01\0", 2);
498 OS.
write(
"\x13\0\0\0", 4);
505 switch (
Fixup.getKind()) {
516 return Value & 0xfff;
519 Ctx.reportError(
Fixup.getLoc(),
520 "operand must be a constant 12-bit integer");
522 return Value & 0xfff;
525 return (((
Value >> 5) & 0x7f) << 25) | ((
Value & 0x1f) << 7);
529 return ((
Value + 0x800) >> 12) & 0xfffff;
532 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
534 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
536 unsigned Sbit = (
Value >> 20) & 0x1;
537 unsigned Hi8 = (
Value >> 12) & 0xff;
538 unsigned Mid1 = (
Value >> 11) & 0x1;
539 unsigned Lo10 = (
Value >> 1) & 0x3ff;
544 Value = (Sbit << 19) | (Lo10 << 9) | (Mid1 << 8) | Hi8;
550 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
552 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
555 unsigned Sbit = (
Value >> 12) & 0x1;
556 unsigned Hi1 = (
Value >> 11) & 0x1;
557 unsigned Mid6 = (
Value >> 5) & 0x3f;
558 unsigned Lo4 = (
Value >> 1) & 0xf;
563 Value = (Sbit << 31) | (Mid6 << 25) | (Lo4 << 8) | (Hi1 << 7);
573 return UpperImm | ((LowerImm << 20) << 32);
577 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
579 unsigned Bit11 = (
Value >> 11) & 0x1;
580 unsigned Bit4 = (
Value >> 4) & 0x1;
581 unsigned Bit9_8 = (
Value >> 8) & 0x3;
582 unsigned Bit10 = (
Value >> 10) & 0x1;
583 unsigned Bit6 = (
Value >> 6) & 0x1;
584 unsigned Bit7 = (
Value >> 7) & 0x1;
585 unsigned Bit3_1 = (
Value >> 1) & 0x7;
586 unsigned Bit5 = (
Value >> 5) & 0x1;
587 Value = (Bit11 << 10) | (Bit4 << 9) | (Bit9_8 << 7) | (Bit10 << 6) |
588 (Bit6 << 5) | (Bit7 << 4) | (Bit3_1 << 1) | Bit5;
593 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
595 unsigned Bit8 = (
Value >> 8) & 0x1;
596 unsigned Bit7_6 = (
Value >> 6) & 0x3;
597 unsigned Bit5 = (
Value >> 5) & 0x1;
598 unsigned Bit4_3 = (
Value >> 3) & 0x3;
599 unsigned Bit2_1 = (
Value >> 1) & 0x3;
600 Value = (Bit8 << 12) | (Bit4_3 << 10) | (Bit7_6 << 5) | (Bit2_1 << 3) |
606 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
607 unsigned Bit5 = (
Value >> 5) & 0x1;
608 unsigned Bit4_0 =
Value & 0x1f;
609 Value = (Bit5 << 12) | (Bit4_0 << 2);
614 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
615 return Value & 0xffffffffu;
619 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
620 unsigned Bit19 = (
Value >> 19) & 0x1;
621 unsigned Bit14_0 =
Value & 0x7fff;
622 unsigned Bit18_15 = (
Value >> 15) & 0xf;
623 Value = (Bit19 << 31) | (Bit14_0 << 16) | (Bit18_15 << 12);
628 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
630 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
637 Value = (Bit31_16 << 32ull) | (Bit12 << 31) | (Bit10_5 << 25) |
638 (Bit15_13 << 17) | (Bit4_1 << 8) | (Bit11 << 7);
643 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
645 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
647 unsigned Sbit = (
Value >> 10) & 0x1;
648 unsigned Hi5 = (
Value >> 5) & 0x1f;
649 unsigned Lo4 = (
Value >> 1) & 0xf;
653 Value = (Sbit << 31) | (Hi5 << 25) | (Lo4 << 8);
663 if (!
F.getParent()->isLinkerRelaxable())
698 if (
DF->getContents().size() ==
Offset) {
708 auto Kind =
F.getKind();
717 case ELF::R_RISCV_GOT_HI20:
718 case ELF::R_RISCV_TLS_GOT_HI20:
719 case ELF::R_RISCV_TLS_GD_HI20:
720 case ELF::R_RISCV_TLSDESC_HI20:
736 switch (
Fixup.getKind()) {
746 "could not find corresponding %pcrel_hi");
763 if (SA.isUndefined())
782 switch (
Fixup.getKind()) {
790 VendorIdentifier =
"QUALCOMM";
793 VendorIdentifier =
"ANDES";
800 MCSymbol *VendorSymbol = Ctx.createLocalSymbol(VendorIdentifier);
801 auto [It, Inserted] =
807 Asm->registerSymbol(*VendorSymbol);
810 VendorSymbol = It->getValue();
819 Asm->getWriter().recordRelocation(
F, VendorFixup, VendorTarget, VendorValue);
847 "relocatable SymA-SymB cannot have relocation specifier");
848 unsigned TA = 0, TB = 0;
849 switch (
Fixup.getKind()) {
851 TA = ELF::R_RISCV_ADD8;
852 TB = ELF::R_RISCV_SUB8;
855 TA = ELF::R_RISCV_ADD16;
856 TB = ELF::R_RISCV_SUB16;
859 TA = ELF::R_RISCV_ADD32;
860 TB = ELF::R_RISCV_SUB32;
863 TA = ELF::R_RISCV_ADD64;
864 TB = ELF::R_RISCV_SUB64;
867 TA = ELF::R_RISCV_SET_ULEB128;
868 TB = ELF::R_RISCV_SUB_ULEB128;
877 Asm->getWriter().recordRelocation(
F, FA,
A, FixedValueA);
878 Asm->getWriter().recordRelocation(
F, FB,
B, FixedValueB);
879 FixedValue = FixedValueA - FixedValueB;
885 bool NeedsRelax =
Fixup.isLinkerRelaxable() &&
890 if (IsResolved &&
Fixup.isPCRel())
907 Asm->getWriter().recordRelocation(
F, RelaxFixup, RelaxTarget, RelaxValue);
945 Value <<= Info.TargetOffset;
947 unsigned NumBytes =
alignTo(Info.TargetSize + Info.TargetOffset, 8) / 8;
949 "Invalid fixup offset!");
955 for (
unsigned i = 0; i != NumBytes; ++i) {
956 unsigned Idx = SwapValue ? (NumBytes - 1 - i) : i;
961std::unique_ptr<MCObjectTargetWriter>
972 std::unique_ptr<MCObjectTargetWriter>
974 const Triple &TT =
STI.getTargetTriple();
981 uint64_t &FixedValue,
bool IsResolved)
override;
994 "could not find corresponding %pcrel_hi");
1012 if (TT.isOSBinFormatMachO())
1014 TT.isLittleEndian(),
Options);
1016 return new RISCVAsmBackend(STI, OSABI, TT.isArch64Bit(), TT.isLittleEndian(),
1022 uint64_t &FixedValue,
bool IsResolved) {
static uint64_t adjustFixupValue(const MCFixup &Fixup, const MCValue &Target, uint64_t Value, MCContext &Ctx, const Triple &TheTriple, bool IsResolved)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements a class to represent arbitrary precision integral constant values and operations...
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
static unsigned getRelaxedOpcode(unsigned Opcode)
PowerPC TLS Dynamic Call Fixup
static cl::opt< bool > AlignRvc("riscv-align-rvc", cl::init(true), cl::Hidden, cl::desc("When generating R_RISCV_ALIGN, insert $alignment-2 " "bytes of NOPs even in norvc code"))
static bool relaxableFixupNeedsRelocation(const MCFixupKind Kind)
static bool isDataFixup(unsigned Kind)
const MCFixup * getPCRelHiFixup(const MCSpecifierExpr &Expr, const MCFragment **DFOut)
static cl::opt< bool > ULEB128Reloc("riscv-uleb128-reloc", cl::init(true), cl::Hidden, cl::desc("Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate"))
std::optional< bool > evaluateFixup(const MCFragment &F, MCFixup &Fixup, MCValue &Target, uint64_t &Value) override
bool addReloc(const MCFragment &, const MCFixup &, const MCValue &, uint64_t &FixedValue, bool IsResolved) override
std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const override
DarwinRISCVAsmBackend(const MCSubtargetInfo &STI, uint8_t OSABI, bool Is64Bit, bool IsLittleEndian, const MCTargetOptions &Options)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Generic interface to target specific assembler backends.
const llvm::endianness Endian
MCAsmBackend(llvm::endianness Endian)
virtual MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
MCContext & getContext() const
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Binary assembler expressions.
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
LLVM_ABI MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
const MCAsmInfo * getAsmInfo() const
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_ABI bool evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm) const
Try to evaluate the expression to a relocatable value, i.e.
static LLVM_ABI bool evaluateSymbolicAdd(const MCAssembler *, bool, const MCValue &, const MCValue &, MCValue &)
LLVM_ABI bool evaluateKnownAbsolute(int64_t &Res, const MCAssembler &Asm) const
Aggressive variant of evaluateAsRelocatable when relocations are unavailable (e.g.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
static MCFixupKind getDataKindForSize(unsigned Size)
Return the generic fixup kind for a value with the given size.
const MCExpr * getValue() const
uint32_t getOffset() const
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, bool PCRel=false)
Consider bit fields if we need more flags.
MCFixupKind getKind() const
const MCExpr & getLEBValue() const
MCSection * getParent() const
LLVM_ABI void setVarFixups(ArrayRef< MCFixup > Fixups)
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
ArrayRef< MCOperand > getOperands() const
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
const MCOperand & getOperand(unsigned i) const
MCRegister getReg() const
Returns the register number.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
const MCExpr * getSubExpr() const
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
const Triple & getTargetTriple() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_ABI void setVariableValue(const MCExpr *Value)
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
MCFragment * getFragment() const
uint64_t getOffset() const
static MCValue get(const MCSymbol *SymA, const MCSymbol *SymB=nullptr, int64_t Val=0, uint32_t Specifier=0)
const MCSymbol * getAddSym() const
int64_t getConstant() const
const MCSymbol * getSubSym() const
std::optional< bool > evaluateFixup(const MCFragment &, MCFixup &, MCValue &, uint64_t &) override
std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const override
bool isPCRelFixupResolved(const MCSymbol *SymA, const MCFragment &F)
void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const override
Relax the instruction in the given fragment to the next wider instruction.
bool relaxAlign(MCFragment &F, unsigned &Size) override
virtual bool addReloc(const MCFragment &, const MCFixup &, const MCValue &, uint64_t &FixedValue, bool IsResolved)
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override
Get information on a fixup kind.
RISCVAsmBackend(const MCSubtargetInfo &STI, uint8_t OSABI, bool Is64Bit, bool IsLittleEndian, const MCTargetOptions &Options)
std::pair< bool, bool > relaxLEB128(MCFragment &LF, int64_t &Value) const override
void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target, uint8_t *Data, uint64_t Value, bool IsResolved) override
bool writeNopData(raw_ostream &OS, uint64_t Count, const MCSubtargetInfo *STI) const override
Write an (optimal) nop sequence of Count bytes to the given output.
const MCSubtargetInfo & STI
void maybeAddVendorReloc(const MCFragment &, const MCFixup &)
StringMap< MCSymbol * > VendorSymbols
bool mayNeedRelaxation(unsigned Opcode, ArrayRef< MCOperand > Operands, const MCSubtargetInfo &STI) const override
Check whether the given instruction (encoded as Opcode+Operands) may need relaxation.
const MCTargetOptions & TargetOptions
bool fixupNeedsRelaxationAdvanced(const MCFragment &, const MCFixup &, const MCValue &, uint64_t, bool) const override
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed...
std::optional< MCFixupKind > getFixupKind(StringRef Name) const override
Map a relocation name used in .reloc to a fixup kind.
bool relaxDwarfCFA(MCFragment &) const override
bool relaxDwarfLineAddr(MCFragment &) const override
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
uint64_t tell() const
tell - Return the current offset with the file.
raw_ostream & write(unsigned char C)
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI Expected< uint32_t > getCPUSubType(const Triple &T)
LLVM_ABI Expected< uint32_t > getCPUType(const Triple &T)
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
@ fixup_riscv_pcrel_lo12_i
@ fixup_riscv_pcrel_lo12_s
@ fixup_riscv_nds_branch_10
@ fixup_riscv_qc_e_call_plt
@ fixup_riscv_qc_e_branch
initializer< Ty > init(const Ty &Val)
bool isRelocation(MCFixupKind FixupKind)
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createRISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit)
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
constexpr bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
std::unique_ptr< MCObjectTargetWriter > createRISCVMachObjectWriter(uint32_t CPUType, uint32_t CPUSubtype)
uint16_t MCFixupKind
Extensible enumeration to represent the type of a fixup.
FunctionAddr VTableAddr Count
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
@ Success
The lock was released successfully.
@ FirstLiteralRelocationKind
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_1
A one-byte fixup.
@ FK_Data_4
A four-byte fixup.
@ FK_Data_leb128
A leb128 fixup.
@ FK_Data_2
A two-byte fixup.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
MCAsmBackend * createRISCVAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Target independent information on a fixup kind.