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::PseudoLongBLT;
202 return RISCV::PseudoLongBGE;
204 return RISCV::PseudoLongBLTU;
206 return RISCV::PseudoLongBGEU;
208 return RISCV::PseudoLongQC_BEQI;
210 return RISCV::PseudoLongQC_BNEI;
212 return RISCV::PseudoLongQC_BLTI;
214 return RISCV::PseudoLongQC_BGEI;
215 case RISCV::QC_BLTUI:
216 return RISCV::PseudoLongQC_BLTUI;
217 case RISCV::QC_BGEUI:
218 return RISCV::PseudoLongQC_BGEUI;
219 case RISCV::QC_E_BEQI:
220 return RISCV::PseudoLongQC_E_BEQI;
221 case RISCV::QC_E_BNEI:
222 return RISCV::PseudoLongQC_E_BNEI;
223 case RISCV::QC_E_BLTI:
224 return RISCV::PseudoLongQC_E_BLTI;
225 case RISCV::QC_E_BGEI:
226 return RISCV::PseudoLongQC_E_BGEI;
227 case RISCV::QC_E_BLTUI:
228 return RISCV::PseudoLongQC_E_BLTUI;
229 case RISCV::QC_E_BGEUI:
230 return RISCV::PseudoLongQC_E_BGEUI;
239 if (
STI.hasFeature(RISCV::FeatureExactAssembly))
254 "Branch Relaxation Error");
260 assert(
STI.hasFeature(RISCV::FeatureVendorXqcilb) &&
261 "JAL is only relaxable with Xqcilb");
264 "JAL only relaxable with rd=x0 or rd=x1");
279 assert(
STI.hasFeature(RISCV::FeatureVendorXqcili) &&
280 "C.LI is only relaxable with Xqcili");
296 case RISCV::QC_BLTUI:
297 case RISCV::QC_BGEUI:
298 case RISCV::QC_E_BEQI:
299 case RISCV::QC_E_BNEI:
300 case RISCV::QC_E_BLTI:
301 case RISCV::QC_E_BGEI:
302 case RISCV::QC_E_BLTUI:
303 case RISCV::QC_E_BGEUI:
310 Inst = std::move(Res);
324 auto *Sec =
F.getParent();
325 if (
F.getLayoutOrder() <= Sec->firstLinkerRelaxable())
331 AlignRvc ||
STI->hasFeature(RISCV::FeatureStdExtZca) ? 2 : 4;
332 if (
F.getAlignment() <= MinNopLen)
335 Size =
F.getAlignment().value() - MinNopLen;
340 F.setLinkerRelaxable();
345 int64_t LineDelta =
F.getDwarfLineDelta();
346 const MCExpr &AddrDelta =
F.getDwarfAddrDelta();
350 if (AddrDelta.evaluateAsAbsolute(
Value, *
Asm))
352 [[maybe_unused]]
bool IsAbsolute =
354 assert(IsAbsolute &&
"CFA with invalid expression");
361 OS <<
uint8_t(dwarf::DW_LNS_advance_line);
372 <<
uint8_t(dwarf::DW_LNE_set_address);
376 OS <<
uint8_t(dwarf::DW_LNS_fixed_advance_pc);
382 OS <<
uint8_t(dwarf::DW_LNS_extended_op);
384 OS <<
uint8_t(dwarf::DW_LNE_end_sequence);
386 OS <<
uint8_t(dwarf::DW_LNS_copy);
389 F.setVarContents(
Data);
396 const MCExpr &AddrDelta =
F.getDwarfAddrDelta();
399 if (AddrDelta.evaluateAsAbsolute(
Value, *
Asm))
401 [[maybe_unused]]
bool IsAbsolute =
403 assert(IsAbsolute &&
"CFA with invalid expression");
406 "expected 1-byte alignment");
408 F.clearVarContents();
413 auto AddFixups = [&Fixups, &AddrDelta](
unsigned Offset,
414 std::pair<unsigned, unsigned>
Fixup) {
423 OS <<
uint8_t(dwarf::DW_CFA_advance_loc);
424 AddFixups(0, {ELF::R_RISCV_SET6, ELF::R_RISCV_SUB6});
426 OS <<
uint8_t(dwarf::DW_CFA_advance_loc1);
428 AddFixups(1, {ELF::R_RISCV_SET8, ELF::R_RISCV_SUB8});
430 OS <<
uint8_t(dwarf::DW_CFA_advance_loc2);
432 AddFixups(1, {ELF::R_RISCV_SET16, ELF::R_RISCV_SUB16});
434 OS <<
uint8_t(dwarf::DW_CFA_advance_loc4);
436 AddFixups(1, {ELF::R_RISCV_SET32, ELF::R_RISCV_SUB32});
440 F.setVarContents(
Data);
441 F.setVarFixups(Fixups);
446 int64_t &
Value)
const {
448 return std::make_pair(
false,
false);
462 if (
STI.hasFeature(RISCV::FeatureExactAssembly))
483 if (
Count % 4 == 2) {
486 OS.
write(
"\x01\0", 2);
492 OS.
write(
"\x13\0\0\0", 4);
499 switch (
Fixup.getKind()) {
510 return Value & 0xfff;
513 Ctx.reportError(
Fixup.getLoc(),
514 "operand must be a constant 12-bit integer");
516 return Value & 0xfff;
519 return (((
Value >> 5) & 0x7f) << 25) | ((
Value & 0x1f) << 7);
523 return ((
Value + 0x800) >> 12) & 0xfffff;
526 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
528 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
530 unsigned Sbit = (
Value >> 20) & 0x1;
531 unsigned Hi8 = (
Value >> 12) & 0xff;
532 unsigned Mid1 = (
Value >> 11) & 0x1;
533 unsigned Lo10 = (
Value >> 1) & 0x3ff;
538 Value = (Sbit << 19) | (Lo10 << 9) | (Mid1 << 8) | Hi8;
544 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
546 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
549 unsigned Sbit = (
Value >> 12) & 0x1;
550 unsigned Hi1 = (
Value >> 11) & 0x1;
551 unsigned Mid6 = (
Value >> 5) & 0x3f;
552 unsigned Lo4 = (
Value >> 1) & 0xf;
557 Value = (Sbit << 31) | (Mid6 << 25) | (Lo4 << 8) | (Hi1 << 7);
567 return UpperImm | ((LowerImm << 20) << 32);
571 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
573 unsigned Bit11 = (
Value >> 11) & 0x1;
574 unsigned Bit4 = (
Value >> 4) & 0x1;
575 unsigned Bit9_8 = (
Value >> 8) & 0x3;
576 unsigned Bit10 = (
Value >> 10) & 0x1;
577 unsigned Bit6 = (
Value >> 6) & 0x1;
578 unsigned Bit7 = (
Value >> 7) & 0x1;
579 unsigned Bit3_1 = (
Value >> 1) & 0x7;
580 unsigned Bit5 = (
Value >> 5) & 0x1;
581 Value = (Bit11 << 10) | (Bit4 << 9) | (Bit9_8 << 7) | (Bit10 << 6) |
582 (Bit6 << 5) | (Bit7 << 4) | (Bit3_1 << 1) | Bit5;
587 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
589 unsigned Bit8 = (
Value >> 8) & 0x1;
590 unsigned Bit7_6 = (
Value >> 6) & 0x3;
591 unsigned Bit5 = (
Value >> 5) & 0x1;
592 unsigned Bit4_3 = (
Value >> 3) & 0x3;
593 unsigned Bit2_1 = (
Value >> 1) & 0x3;
594 Value = (Bit8 << 12) | (Bit4_3 << 10) | (Bit7_6 << 5) | (Bit2_1 << 3) |
600 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
601 unsigned Bit5 = (
Value >> 5) & 0x1;
602 unsigned Bit4_0 =
Value & 0x1f;
603 Value = (Bit5 << 12) | (Bit4_0 << 2);
608 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
609 return Value & 0xffffffffu;
613 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
614 unsigned Bit19 = (
Value >> 19) & 0x1;
615 unsigned Bit14_0 =
Value & 0x7fff;
616 unsigned Bit18_15 = (
Value >> 15) & 0xf;
617 Value = (Bit19 << 31) | (Bit14_0 << 16) | (Bit18_15 << 12);
622 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
624 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
631 Value = (Bit31_16 << 32ull) | (Bit12 << 31) | (Bit10_5 << 25) |
632 (Bit15_13 << 17) | (Bit4_1 << 8) | (Bit11 << 7);
637 Ctx.reportError(
Fixup.getLoc(),
"fixup value out of range");
639 Ctx.reportError(
Fixup.getLoc(),
"fixup value must be 2-byte aligned");
641 unsigned Sbit = (
Value >> 10) & 0x1;
642 unsigned Hi5 = (
Value >> 5) & 0x1f;
643 unsigned Lo4 = (
Value >> 1) & 0xf;
647 Value = (Sbit << 31) | (Hi5 << 25) | (Lo4 << 8);
657 if (!
F.getParent()->isLinkerRelaxable())
692 if (
DF->getContents().size() ==
Offset) {
702 auto Kind =
F.getKind();
711 case ELF::R_RISCV_GOT_HI20:
712 case ELF::R_RISCV_TLS_GOT_HI20:
713 case ELF::R_RISCV_TLS_GD_HI20:
714 case ELF::R_RISCV_TLSDESC_HI20:
730 switch (
Fixup.getKind()) {
740 "could not find corresponding %pcrel_hi");
757 if (SA.isUndefined())
776 switch (
Fixup.getKind()) {
784 VendorIdentifier =
"QUALCOMM";
787 VendorIdentifier =
"ANDES";
794 MCSymbol *VendorSymbol = Ctx.createLocalSymbol(VendorIdentifier);
795 auto [It, Inserted] =
801 Asm->registerSymbol(*VendorSymbol);
804 VendorSymbol = It->getValue();
813 Asm->getWriter().recordRelocation(
F, VendorFixup, VendorTarget, VendorValue);
841 "relocatable SymA-SymB cannot have relocation specifier");
842 unsigned TA = 0, TB = 0;
843 switch (
Fixup.getKind()) {
845 TA = ELF::R_RISCV_ADD8;
846 TB = ELF::R_RISCV_SUB8;
849 TA = ELF::R_RISCV_ADD16;
850 TB = ELF::R_RISCV_SUB16;
853 TA = ELF::R_RISCV_ADD32;
854 TB = ELF::R_RISCV_SUB32;
857 TA = ELF::R_RISCV_ADD64;
858 TB = ELF::R_RISCV_SUB64;
861 TA = ELF::R_RISCV_SET_ULEB128;
862 TB = ELF::R_RISCV_SUB_ULEB128;
871 Asm->getWriter().recordRelocation(
F, FA,
A, FixedValueA);
872 Asm->getWriter().recordRelocation(
F, FB,
B, FixedValueB);
873 FixedValue = FixedValueA - FixedValueB;
879 bool NeedsRelax =
Fixup.isLinkerRelaxable() &&
884 if (IsResolved &&
Fixup.isPCRel())
901 Asm->getWriter().recordRelocation(
F, RelaxFixup, RelaxTarget, RelaxValue);
939 Value <<= Info.TargetOffset;
941 unsigned NumBytes =
alignTo(Info.TargetSize + Info.TargetOffset, 8) / 8;
943 "Invalid fixup offset!");
949 for (
unsigned i = 0; i != NumBytes; ++i) {
950 unsigned Idx = SwapValue ? (NumBytes - 1 - i) : i;
955std::unique_ptr<MCObjectTargetWriter>
966 std::unique_ptr<MCObjectTargetWriter>
968 const Triple &TT =
STI.getTargetTriple();
981 if (TT.isOSBinFormatMachO())
984 return new RISCVAsmBackend(STI, OSABI, TT.isArch64Bit(), TT.isLittleEndian(),
unsigned const MachineRegisterInfo * MRI
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)
static 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::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
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.