21#define DEBUG_TYPE "aarch64-disassembler"
25 switch (LLVMDisassembler_VariantKind) {
72 memset(&SymbolicOp,
'\0',
sizeof(
struct LLVMOpInfo1));
75 const char *ReferenceName;
90 CommentStream <<
"symbol stub for: " << ReferenceName;
93 CommentStream <<
"Objc message: " << ReferenceName;
94 }
else if (
MI.getOpcode() == AArch64::ADRP) {
100 EncodedInst |= (
Value & 0x3) << 29;
101 EncodedInst |= ((
Value >> 2) & 0x7FFFF) << 5;
105 CommentStream <<
format(
"0x%llx", (0xfffffffffffff000LL &
Address) +
107 }
else if (
MI.getOpcode() == AArch64::ADDXri ||
108 MI.getOpcode() == AArch64::LDRXui ||
109 MI.getOpcode() == AArch64::LDRXl ||
110 MI.getOpcode() == AArch64::ADR) {
111 if (
MI.getOpcode() == AArch64::ADDXri)
113 else if (
MI.getOpcode() == AArch64::LDRXui)
115 if (
MI.getOpcode() == AArch64::LDRXl) {
119 }
else if (
MI.getOpcode() == AArch64::ADR) {
127 unsigned EncodedInst =
128 MI.getOpcode() == AArch64::ADDXri ? 0x91000000: 0xF9400000;
129 EncodedInst |=
Value << 10;
138 CommentStream <<
"literal pool symbol address: " << ReferenceName;
141 CommentStream <<
"literal pool for: \"";
143 CommentStream <<
"\"";
146 CommentStream <<
"Objc cfstring ref: @\"" << ReferenceName <<
"\"";
149 CommentStream <<
"Objc message: " << ReferenceName;
152 CommentStream <<
"Objc message ref: " << ReferenceName;
155 CommentStream <<
"Objc selector ref: " << ReferenceName;
158 CommentStream <<
"Objc class ref: " << ReferenceName;
184 const MCExpr *Sub =
nullptr;
195 const MCExpr *Off =
nullptr;
196 if (SymbolicOp.
Value != 0)
static MCSymbolRefExpr::VariantKind getVariant(uint64_t LLVMDisassembler_VariantKind)
bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &CommentStream, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t OpSize, uint64_t InstSize) override
tryAddingSymbolicOperand - tryAddingSymbolicOperand trys to add a symbolic operand in place of the im...
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
const MCRegisterInfo * getRegisterInfo() const
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
void * DisInfo
The pointer to the block of symbolic information for above call back.
LLVMOpInfoCallback GetOpInfo
LLVMSymbolLookupCallback SymbolLookUp
The function to lookup a symbol name.
Instances of this class represent a single low-level machine instruction.
static MCOperand createExpr(const MCExpr *Val)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
uint16_t getEncodingValue(MCRegister RegNo) const
Returns the encoding for RegNo.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static const MCUnaryExpr * createMinus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_escaped(StringRef Str, bool UseHexEscapes=false)
Output Str, turning '\', '\t', ' ', '"', and anything that doesn't satisfy llvm::isPrint into an esca...
#define LLVMDisassembler_VariantKind_ARM64_TLVOFF
#define LLVMDisassembler_ReferenceType_In_ARM64_ADR
#define LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF
#define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref
#define LLVMDisassembler_VariantKind_ARM64_TLVP
#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri
#define LLVMDisassembler_ReferenceType_Out_SymbolStub
#define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref
#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP
#define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr
#define LLVMDisassembler_ReferenceType_In_Branch
#define LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr
#define LLVMDisassembler_ReferenceType_Out_Objc_Message
#define LLVMDisassembler_VariantKind_ARM64_PAGE
The ARM64 target VariantKinds.
#define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref
#define LLVMDisassembler_VariantKind_ARM64_PAGEOFF
#define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref
#define LLVMDisassembler_VariantKind_ARM64_GOTPAGE
#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl
#define LLVMDisassembler_VariantKind_None
The operand VariantKinds for symbolic disassembly.
#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
struct LLVMOpInfoSymbol1 SubtractSymbol
struct LLVMOpInfoSymbol1 AddSymbol