33    cl::desc(
"Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate"));
 
   37             cl::desc(
"When generating R_RISCV_ALIGN, insert $alignment-2 " 
   38                      "bytes of NOPs even in norvc code"));
 
   41                                 bool Is64Bit, 
bool IsLittleEndian,
 
   45      STI(STI), OSABI(OSABI), Is64Bit(Is64Bit), TargetOptions(
Options) {
 
 
   50  if (STI.getTargetTriple().isOSBinFormatELF()) {
 
   53#define ELF_RELOC(NAME, ID) .Case(#NAME, ID) 
   54#include "llvm/BinaryFormat/ELFRelocs/RISCV.def" 
   56#define ELF_RISCV_NONSTANDARD_RELOC(_VENDOR, NAME, ID) .Case(#NAME, ID) 
   57#include "llvm/BinaryFormat/ELFRelocs/RISCV_nonstandard.def" 
   58#undef ELF_RISCV_NONSTANDARD_RELOC 
   59               .
Case(
"BFD_RELOC_NONE", ELF::R_RISCV_NONE)
 
   60               .
Case(
"BFD_RELOC_32", ELF::R_RISCV_32)
 
   61               .
Case(
"BFD_RELOC_64", ELF::R_RISCV_64)
 
 
   75      {
"fixup_riscv_hi20", 12, 20, 0},
 
   76      {
"fixup_riscv_lo12_i", 20, 12, 0},
 
   77      {
"fixup_riscv_12_i", 20, 12, 0},
 
   78      {
"fixup_riscv_lo12_s", 0, 32, 0},
 
   79      {
"fixup_riscv_pcrel_hi20", 12, 20, 0},
 
   80      {
"fixup_riscv_pcrel_lo12_i", 20, 12, 0},
 
   81      {
"fixup_riscv_pcrel_lo12_s", 0, 32, 0},
 
   82      {
"fixup_riscv_jal", 12, 20, 0},
 
   83      {
"fixup_riscv_branch", 0, 32, 0},
 
   84      {
"fixup_riscv_rvc_jump", 2, 11, 0},
 
   85      {
"fixup_riscv_rvc_branch", 0, 16, 0},
 
   86      {
"fixup_riscv_rvc_imm", 0, 16, 0},
 
   87      {
"fixup_riscv_call", 0, 64, 0},
 
   88      {
"fixup_riscv_call_plt", 0, 64, 0},
 
   90      {
"fixup_riscv_qc_e_branch", 0, 48, 0},
 
   91      {
"fixup_riscv_qc_e_32", 16, 32, 0},
 
   92      {
"fixup_riscv_qc_abs20_u", 0, 32, 0},
 
   93      {
"fixup_riscv_qc_e_call_plt", 0, 48, 0},
 
   96      {
"fixup_riscv_nds_branch_10", 0, 32, 0},
 
   99                "Not all fixup kinds added to Infos array");
 
 
  118                                                   bool Resolved)
 const {
 
  120  auto Kind = 
Fixup.getKind();
 
 
  169    if (!STI.
hasFeature(RISCV::FeatureVendorXqcili))
 
  179    return RISCV::QC_E_LI;
 
  182    if (!STI.
hasFeature(RISCV::FeatureVendorXqcilb))
 
  187    if (
Reg == RISCV::X0)
 
  188      return RISCV::QC_E_J;
 
  189    if (
Reg == RISCV::X1)
 
  190      return RISCV::QC_E_JAL;
 
  195    return RISCV::PseudoLongBEQ;
 
  197    return RISCV::PseudoLongBNE;
 
  199    return RISCV::PseudoLongBLT;
 
  201    return RISCV::PseudoLongBGE;
 
  203    return RISCV::PseudoLongBLTU;
 
  205    return RISCV::PseudoLongBGEU;
 
  207    return RISCV::PseudoLongQC_BEQI;
 
  209    return RISCV::PseudoLongQC_BNEI;
 
  211    return RISCV::PseudoLongQC_BLTI;
 
  213    return RISCV::PseudoLongQC_BGEI;
 
  214  case RISCV::QC_BLTUI:
 
  215    return RISCV::PseudoLongQC_BLTUI;
 
  216  case RISCV::QC_BGEUI:
 
  217    return RISCV::PseudoLongQC_BGEUI;
 
  218  case RISCV::QC_E_BEQI:
 
  219    return RISCV::PseudoLongQC_E_BEQI;
 
  220  case RISCV::QC_E_BNEI:
 
  221    return RISCV::PseudoLongQC_E_BNEI;
 
  222  case RISCV::QC_E_BLTI:
 
  223    return RISCV::PseudoLongQC_E_BLTI;
 
  224  case RISCV::QC_E_BGEI:
 
  225    return RISCV::PseudoLongQC_E_BGEI;
 
  226  case RISCV::QC_E_BLTUI:
 
  227    return RISCV::PseudoLongQC_E_BLTUI;
 
  228  case RISCV::QC_E_BGEUI:
 
  229    return RISCV::PseudoLongQC_E_BGEUI;
 
 
  238  if (STI.hasFeature(RISCV::FeatureExactAssembly))
 
  253           "Branch Relaxation Error");
 
  259    assert(STI.hasFeature(RISCV::FeatureVendorXqcilb) &&
 
  260           "JAL is only relaxable with Xqcilb");
 
  263           "JAL only relaxable with rd=x0 or rd=x1");
 
  278    assert(STI.hasFeature(RISCV::FeatureVendorXqcili) &&
 
  279           "C.LI is only relaxable with Xqcili");
 
  295  case RISCV::QC_BLTUI:
 
  296  case RISCV::QC_BGEUI:
 
  297  case RISCV::QC_E_BEQI:
 
  298  case RISCV::QC_E_BNEI:
 
  299  case RISCV::QC_E_BLTI:
 
  300  case RISCV::QC_E_BGEI:
 
  301  case RISCV::QC_E_BLTUI:
 
  302  case RISCV::QC_E_BGEUI:
 
  309  Inst = std::move(Res);
 
 
  323  auto *Sec = 
F.getParent();
 
  324  if (
F.getLayoutOrder() <= Sec->firstLinkerRelaxable())
 
  330      AlignRvc || STI->hasFeature(RISCV::FeatureStdExtZca) ? 2 : 4;
 
  331  if (
F.getAlignment() <= MinNopLen)
 
  334  Size = 
F.getAlignment().value() - MinNopLen;
 
  339  F.setLinkerRelaxable();
 
 
  344  int64_t LineDelta = 
F.getDwarfLineDelta();
 
  345  const MCExpr &AddrDelta = 
F.getDwarfAddrDelta();
 
  349  if (AddrDelta.evaluateAsAbsolute(
Value, *
Asm))
 
  351  [[maybe_unused]] 
bool IsAbsolute =
 
  353  assert(IsAbsolute && 
"CFA with invalid expression");
 
  360    OS << 
uint8_t(dwarf::DW_LNS_advance_line);
 
  371       << 
uint8_t(dwarf::DW_LNE_set_address);
 
  375    OS << 
uint8_t(dwarf::DW_LNS_fixed_advance_pc);
 
  381    OS << 
uint8_t(dwarf::DW_LNS_extended_op);
 
  383    OS << 
uint8_t(dwarf::DW_LNE_end_sequence);
 
  385    OS << 
uint8_t(dwarf::DW_LNS_copy);
 
  388  F.setVarContents(
Data);
 
 
  395  const MCExpr &AddrDelta = 
F.getDwarfAddrDelta();
 
  398  if (AddrDelta.evaluateAsAbsolute(
Value, *
Asm))
 
  400  [[maybe_unused]] 
bool IsAbsolute =
 
  402  assert(IsAbsolute && 
"CFA with invalid expression");
 
  405         "expected 1-byte alignment");
 
  407    F.clearVarContents();
 
  412  auto AddFixups = [&Fixups, &AddrDelta](
unsigned Offset,
 
  413                                         std::pair<unsigned, unsigned> 
Fixup) {
 
  422    OS << 
uint8_t(dwarf::DW_CFA_advance_loc);
 
  423    AddFixups(0, {ELF::R_RISCV_SET6, ELF::R_RISCV_SUB6});
 
  425    OS << 
uint8_t(dwarf::DW_CFA_advance_loc1);
 
  427    AddFixups(1, {ELF::R_RISCV_SET8, ELF::R_RISCV_SUB8});
 
  429    OS << 
uint8_t(dwarf::DW_CFA_advance_loc2);
 
  431    AddFixups(1, {ELF::R_RISCV_SET16, ELF::R_RISCV_SUB16});
 
  433    OS << 
uint8_t(dwarf::DW_CFA_advance_loc4);
 
  435    AddFixups(1, {ELF::R_RISCV_SET32, ELF::R_RISCV_SUB32});
 
  439  F.setVarContents(
Data);
 
  440  F.setVarFixups(Fixups);
 
 
  445                                                   int64_t &
Value)
 const {
 
  447    return std::make_pair(
false, 
false);
 
 
  461  if (STI.hasFeature(RISCV::FeatureExactAssembly))
 
 
  482  if (
Count % 4 == 2) {
 
  485    OS.
write(
"\x01\0", 2);
 
  491    OS.
write(
"\x13\0\0\0", 4);
 
 
  498  switch (
Fixup.getKind()) {
 
  509    return Value & 0xfff;
 
  512      Ctx.reportError(
Fixup.getLoc(),
 
  513                      "operand must be a constant 12-bit integer");
 
  515    return Value & 0xfff;
 
  518    return (((
Value >> 5) & 0x7f) << 25) | ((
Value & 0x1f) << 7);
 
  522    return ((
Value + 0x800) >> 12) & 0xfffff;
 
  525      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  527      Ctx.reportError(
Fixup.getLoc(), 
"fixup value must be 2-byte aligned");
 
  529    unsigned Sbit = (
Value >> 20) & 0x1;
 
  530    unsigned Hi8 = (
Value >> 12) & 0xff;
 
  531    unsigned Mid1 = (
Value >> 11) & 0x1;
 
  532    unsigned Lo10 = (
Value >> 1) & 0x3ff;
 
  537    Value = (Sbit << 19) | (Lo10 << 9) | (Mid1 << 8) | Hi8;
 
  543      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  545      Ctx.reportError(
Fixup.getLoc(), 
"fixup value must be 2-byte aligned");
 
  548    unsigned Sbit = (
Value >> 12) & 0x1;
 
  549    unsigned Hi1 = (
Value >> 11) & 0x1;
 
  550    unsigned Mid6 = (
Value >> 5) & 0x3f;
 
  551    unsigned Lo4 = (
Value >> 1) & 0xf;
 
  556    Value = (Sbit << 31) | (Mid6 << 25) | (Lo4 << 8) | (Hi1 << 7);
 
  566    return UpperImm | ((LowerImm << 20) << 32);
 
  570      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  572    unsigned Bit11  = (
Value >> 11) & 0x1;
 
  573    unsigned Bit4   = (
Value >> 4) & 0x1;
 
  574    unsigned Bit9_8 = (
Value >> 8) & 0x3;
 
  575    unsigned Bit10  = (
Value >> 10) & 0x1;
 
  576    unsigned Bit6   = (
Value >> 6) & 0x1;
 
  577    unsigned Bit7   = (
Value >> 7) & 0x1;
 
  578    unsigned Bit3_1 = (
Value >> 1) & 0x7;
 
  579    unsigned Bit5   = (
Value >> 5) & 0x1;
 
  580    Value = (Bit11 << 10) | (Bit4 << 9) | (Bit9_8 << 7) | (Bit10 << 6) |
 
  581            (Bit6 << 5) | (Bit7 << 4) | (Bit3_1 << 1) | Bit5;
 
  586      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  588    unsigned Bit8   = (
Value >> 8) & 0x1;
 
  589    unsigned Bit7_6 = (
Value >> 6) & 0x3;
 
  590    unsigned Bit5   = (
Value >> 5) & 0x1;
 
  591    unsigned Bit4_3 = (
Value >> 3) & 0x3;
 
  592    unsigned Bit2_1 = (
Value >> 1) & 0x3;
 
  593    Value = (Bit8 << 12) | (Bit4_3 << 10) | (Bit7_6 << 5) | (Bit2_1 << 3) |
 
  599      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  600    unsigned Bit5 = (
Value >> 5) & 0x1;
 
  601    unsigned Bit4_0 = 
Value & 0x1f;
 
  602    Value = (Bit5 << 12) | (Bit4_0 << 2);
 
  607      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  608    return Value & 0xffffffffu;
 
  612      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  613    unsigned Bit19 = (
Value >> 19) & 0x1;
 
  614    unsigned Bit14_0 = 
Value & 0x7fff;
 
  615    unsigned Bit18_15 = (
Value >> 15) & 0xf;
 
  616    Value = (Bit19 << 31) | (Bit14_0 << 16) | (Bit18_15 << 12);
 
  621      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  623      Ctx.reportError(
Fixup.getLoc(), 
"fixup value must be 2-byte aligned");
 
  630    Value = (Bit31_16 << 32ull) | (Bit12 << 31) | (Bit10_5 << 25) |
 
  631            (Bit15_13 << 17) | (Bit4_1 << 8) | (Bit11 << 7);
 
  636      Ctx.reportError(
Fixup.getLoc(), 
"fixup value out of range");
 
  638      Ctx.reportError(
Fixup.getLoc(), 
"fixup value must be 2-byte aligned");
 
  640    unsigned Sbit = (
Value >> 10) & 0x1;
 
  641    unsigned Hi5 = (
Value >> 5) & 0x1f;
 
  642    unsigned Lo4 = (
Value >> 1) & 0xf;
 
  646    Value = (Sbit << 31) | (Hi5 << 25) | (Lo4 << 8);
 
 
  652bool RISCVAsmBackend::isPCRelFixupResolved(
const MCSymbol *SymA,
 
  656  if (!
F.getParent()->isLinkerRelaxable())
 
  691  if (
DF->getContents().size() == 
Offset) {
 
  701    auto Kind = 
F.getKind();
 
  710    case ELF::R_RISCV_GOT_HI20:
 
  711    case ELF::R_RISCV_TLS_GOT_HI20:
 
  712    case ELF::R_RISCV_TLS_GD_HI20:
 
  713    case ELF::R_RISCV_TLSDESC_HI20:
 
 
  729  switch (
Fixup.getKind()) {
 
  739                               "could not find corresponding %pcrel_hi");
 
  756  if (SA.isUndefined())
 
  769         isPCRelFixupResolved(AUIPCTarget.
getAddSym(), *AUIPCDF);
 
 
  775  switch (
Fixup.getKind()) {
 
  783    VendorIdentifier = 
"QUALCOMM";
 
  786    VendorIdentifier = 
"ANDES";
 
  793  MCSymbol *VendorSymbol = Ctx.createLocalSymbol(VendorIdentifier);
 
  794  auto [It, Inserted] =
 
  795      VendorSymbols.try_emplace(VendorIdentifier, VendorSymbol);
 
  800    Asm->registerSymbol(*VendorSymbol);
 
  803    VendorSymbol = It->getValue();
 
  812  Asm->getWriter().recordRelocation(
F, VendorFixup, VendorTarget, VendorValue);
 
 
  839           "relocatable SymA-SymB cannot have relocation specifier");
 
  840    unsigned TA = 0, TB = 0;
 
  841    switch (
Fixup.getKind()) {
 
  843      TA = ELF::R_RISCV_ADD8;
 
  844      TB = ELF::R_RISCV_SUB8;
 
  847      TA = ELF::R_RISCV_ADD16;
 
  848      TB = ELF::R_RISCV_SUB16;
 
  851      TA = ELF::R_RISCV_ADD32;
 
  852      TB = ELF::R_RISCV_SUB32;
 
  855      TA = ELF::R_RISCV_ADD64;
 
  856      TB = ELF::R_RISCV_SUB64;
 
  859      TA = ELF::R_RISCV_SET_ULEB128;
 
  860      TB = ELF::R_RISCV_SUB_ULEB128;
 
  869    Asm->getWriter().recordRelocation(
F, FA, 
A, FixedValueA);
 
  870    Asm->getWriter().recordRelocation(
F, FB, 
B, FixedValueB);
 
  871    FixedValue = FixedValueA - FixedValueB;
 
  877  bool NeedsRelax = 
Fixup.isLinkerRelaxable() &&
 
  882  if (IsResolved && 
Fixup.isPCRel())
 
  883    IsResolved = isPCRelFixupResolved(
Target.getAddSym(), 
F);
 
  899      Asm->getWriter().recordRelocation(
F, RelaxFixup, RelaxTarget, RelaxValue);
 
 
  937  Value <<= Info.TargetOffset;
 
  939  unsigned NumBytes = 
alignTo(Info.TargetSize + Info.TargetOffset, 8) / 8;
 
  941         "Invalid fixup offset!");
 
  947  for (
unsigned i = 0; i != NumBytes; ++i) {
 
  948    unsigned Idx = SwapValue ? (NumBytes - 1 - i) : i;
 
 
  953std::unique_ptr<MCObjectTargetWriter>
 
  964  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"))
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 ...
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
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
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.
void maybeAddVendorReloc(const MCFragment &, const MCFixup &)
bool mayNeedRelaxation(unsigned Opcode, ArrayRef< MCOperand > Operands, const MCSubtargetInfo &STI) const override
Check whether the given instruction (encoded as Opcode+Operands) may need relaxation.
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.
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.
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.
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.