22 #define DEBUG_TYPE "aarch64-disassembler"
26 switch (LLVMDisassembler_VariantKind) {
62 bool IsBranch, uint64_t
Offset, uint64_t InstSize) {
69 memset(&SymbolicOp,
'\0',
sizeof(
struct LLVMOpInfo1));
71 uint64_t ReferenceType;
72 const char *ReferenceName;
78 Address, &ReferenceName);
87 CommentStream <<
"symbol stub for: " << ReferenceName;
88 else if (ReferenceType ==
90 CommentStream <<
"Objc message: " << ReferenceName;
97 EncodedInst |= (Value & 0x3) << 29;
98 EncodedInst |= ((Value >> 2) & 0x7FFFF) << 5;
102 CommentStream <<
format(
"0x%llx",
103 0xfffffffffffff000LL & (Address + Value));
104 }
else if (MI.
getOpcode() == AArch64::ADDXri ||
110 else if (MI.
getOpcode() == AArch64::LDRXui)
116 }
else if (MI.
getOpcode() == AArch64::ADR) {
124 unsigned EncodedInst =
125 MI.
getOpcode() == AArch64::ADDXri ? 0x91000000: 0xF9400000;
126 EncodedInst |= Value << 10;
135 CommentStream <<
"literal pool symbol address: " << ReferenceName;
136 else if (ReferenceType ==
138 CommentStream <<
"literal pool for: \"";
140 CommentStream <<
"\"";
141 }
else if (ReferenceType ==
143 CommentStream <<
"Objc cfstring ref: @\"" << ReferenceName <<
"\"";
144 else if (ReferenceType ==
146 CommentStream <<
"Objc message: " << ReferenceName;
147 else if (ReferenceType ==
149 CommentStream <<
"Objc message ref: " << ReferenceName;
150 else if (ReferenceType ==
152 CommentStream <<
"Objc selector ref: " << ReferenceName;
153 else if (ReferenceType ==
155 CommentStream <<
"Objc class ref: " << ReferenceName;
181 const MCExpr *Sub =
nullptr;
192 const MCExpr *Off =
nullptr;
193 if (SymbolicOp.
Value != 0)
static const MCUnaryExpr * createMinus(const MCExpr *Expr, MCContext &Ctx)
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 MCOperand createExpr(const MCExpr *Val)
#define LLVMDisassembler_ReferenceType_In_Branch
#define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref
#define LLVMDisassembler_ReferenceType_Out_SymbolStub
void * DisInfo
The pointer to the block of symbolic information for above call back.
#define LLVMDisassembler_VariantKind_ARM64_TLVP
static MCSymbolRefExpr::VariantKind getVariant(uint64_t LLVMDisassembler_VariantKind)
Base class for the full range of assembler expressions which are needed for parsing.
#define LLVMDisassembler_VariantKind_None
The operand VariantKinds for symbolic disassembly.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
unsigned getReg() const
Returns the register number.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
#define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref
#define LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &CommentStream, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize) override
tryAddingSymbolicOperand - tryAddingSymbolicOperand trys to add a symbolic operand in place of the im...
#define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr
#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP
#define LLVMDisassembler_VariantKind_ARM64_TLVOFF
struct LLVMOpInfoSymbol1 AddSymbol
struct LLVMOpInfoSymbol1 SubtractSymbol
#define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref
#define LLVMDisassembler_VariantKind_ARM64_PAGEOFF
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
#define LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr
raw_ostream & write_escaped(StringRef Str, bool UseHexEscapes=false)
Output Str, turning '\', '', ' ', '"', and anything that doesn't satisfy std::isprint into an escape...
#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl
unsigned getOpcode() const
#define LLVMDisassembler_VariantKind_ARM64_PAGE
The ARM64 target VariantKinds.
#define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref
const MCRegisterInfo * getRegisterInfo() const
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri
#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui
#define LLVMDisassembler_ReferenceType_In_ARM64_ADR
#define LLVMDisassembler_VariantKind_ARM64_GOTPAGE
uint16_t getEncodingValue(unsigned RegNo) const
Returns the encoding for RegNo.
LLVM Value Representation.
LLVMOpInfoCallback GetOpInfo
This class implements an extremely fast bulk output stream that can only output to a stream...
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
const MCOperand & getOperand(unsigned i) const
LLVMSymbolLookupCallback SymbolLookUp
The function to lookup a symbol name.
#define LLVMDisassembler_ReferenceType_Out_Objc_Message