LLVM 22.0.0git
RISCVAsmBackend.cpp File Reference
#include "RISCVAsmBackend.h"
#include "RISCVFixupKinds.h"
#include "llvm/ADT/APInt.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
#include "llvm/BinaryFormat/ELFRelocs/RISCV_nonstandard.def"

Go to the source code of this file.

Macros

#define ELF_RELOC(NAME, ID)
#define ELF_RISCV_NONSTANDARD_RELOC(_VENDOR, NAME, ID)

Functions

static unsigned getRelaxedOpcode (unsigned Opcode, ArrayRef< MCOperand > Operands, const MCSubtargetInfo &STI)
static uint64_t adjustFixupValue (const MCFixup &Fixup, uint64_t Value, MCContext &Ctx)
static const MCFixupgetPCRelHiFixup (const MCSpecifierExpr &Expr, const MCFragment **DFOut)
static bool relaxableFixupNeedsRelocation (const MCFixupKind Kind)
static bool isDataFixup (unsigned Kind)

Variables

static cl::opt< boolULEB128Reloc ("riscv-uleb128-reloc", cl::init(true), cl::Hidden, cl::desc("Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate"))
static cl::opt< boolAlignRvc ("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"))

Macro Definition Documentation

◆ ELF_RELOC

#define ELF_RELOC ( NAME,
ID )
Value:
.Case(#NAME, ID)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24

◆ ELF_RISCV_NONSTANDARD_RELOC

#define ELF_RISCV_NONSTANDARD_RELOC ( _VENDOR,
NAME,
ID )
Value:
.Case(#NAME, ID)

Function Documentation

◆ adjustFixupValue()

◆ getPCRelHiFixup()

◆ getRelaxedOpcode()

unsigned getRelaxedOpcode ( unsigned Opcode,
ArrayRef< MCOperand > Operands,
const MCSubtargetInfo & STI )
static

Definition at line 156 of file RISCVAsmBackend.cpp.

References llvm::MCSubtargetInfo::hasFeature(), Operands, and Reg.

◆ isDataFixup()

bool isDataFixup ( unsigned Kind)
static

◆ relaxableFixupNeedsRelocation()

bool relaxableFixupNeedsRelocation ( const MCFixupKind Kind)
static

Variable Documentation

◆ AlignRvc

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")) ( "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

◆ ULEB128Reloc

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")) ( "riscv-uleb128-reloc" ,
cl::init(true) ,
cl::Hidden ,
cl::desc("Emit R_RISCV_SET_ULEB128/E_RISCV_SUB_ULEB128 if appropriate")  )
static