20#define DEBUG_TYPE "aarch64-disassembler"
24 switch (LLVMDisassembler_VariantKind) {
71 memset(&SymbolicOp,
'\0',
sizeof(
struct LLVMOpInfo1));
74 const char *ReferenceName;
89 CommentStream <<
"symbol stub for: " << ReferenceName;
92 CommentStream <<
"Objc message: " << ReferenceName;
93 }
else if (
MI.getOpcode() == AArch64::ADRP) {
99 EncodedInst |= (
Value & 0x3) << 29;
100 EncodedInst |= ((
Value >> 2) & 0x7FFFF) << 5;
104 CommentStream <<
format(
"0x%llx", (0xfffffffffffff000LL &
Address) +
106 }
else if (
MI.getOpcode() == AArch64::ADDXri ||
107 MI.getOpcode() == AArch64::LDRXui ||
108 MI.getOpcode() == AArch64::LDRXl ||
109 MI.getOpcode() == AArch64::ADR) {
110 if (
MI.getOpcode() == AArch64::ADDXri)
112 else if (
MI.getOpcode() == AArch64::LDRXui)
114 if (
MI.getOpcode() == AArch64::LDRXl) {
118 }
else if (
MI.getOpcode() == AArch64::ADR) {
126 unsigned EncodedInst =
127 MI.getOpcode() == AArch64::ADDXri ? 0x91000000: 0xF9400000;
128 EncodedInst |=
Value << 10;
137 CommentStream <<
"literal pool symbol address: " << ReferenceName;
140 CommentStream <<
"literal pool for: \"";
142 CommentStream <<
"\"";
145 CommentStream <<
"Objc cfstring ref: @\"" << ReferenceName <<
"\"";
148 CommentStream <<
"Objc message: " << ReferenceName;
151 CommentStream <<
"Objc message ref: " << ReferenceName;
154 CommentStream <<
"Objc selector ref: " << ReferenceName;
157 CommentStream <<
"Objc class ref: " << ReferenceName;
183 const MCExpr *Sub =
nullptr;
194 const MCExpr *Off =
nullptr;
195 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 Reg) const
Returns the encoding for Reg.
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