22 #define DEBUG_TYPE "aarch64-disassembler" 26 switch (LLVMDisassembler_VariantKind) {
62 bool IsBranch, uint64_t
Offset, uint64_t InstSize) {
73 uint64_t ReferenceType;
74 const char *ReferenceName;
80 Address, &ReferenceName);
89 CommentStream <<
"symbol stub for: " << ReferenceName;
90 else if (ReferenceType ==
92 CommentStream <<
"Objc message: " << ReferenceName;
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 ||
112 else if (MI.
getOpcode() == AArch64::LDRXui)
126 unsigned EncodedInst =
127 MI.
getOpcode() == AArch64::ADDXri ? 0x91000000: 0xF9400000;
128 EncodedInst |= Value << 10;
137 CommentStream <<
"literal pool symbol address: " << ReferenceName;
138 else if (ReferenceType ==
140 CommentStream <<
"literal pool for: \"";
142 CommentStream <<
"\"";
143 }
else if (ReferenceType ==
145 CommentStream <<
"Objc cfstring ref: @\"" << ReferenceName <<
"\"";
146 else if (ReferenceType ==
148 CommentStream <<
"Objc message: " << ReferenceName;
149 else if (ReferenceType ==
151 CommentStream <<
"Objc message ref: " << ReferenceName;
152 else if (ReferenceType ==
154 CommentStream <<
"Objc selector ref: " << ReferenceName;
155 else if (ReferenceType ==
157 CommentStream <<
"Objc class ref: " << ReferenceName;
183 const MCExpr *Sub =
nullptr;
194 const MCExpr *Off =
nullptr;
195 if (SymbolicOp.
Value != 0)
#define LLVMDisassembler_ReferenceType_In_ARM64_ADR
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
#define LLVMDisassembler_ReferenceType_Out_Objc_Message
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static MCOperand createExpr(const MCExpr *Val)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
#define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref
#define LLVMDisassembler_VariantKind_ARM64_TLVOFF
void * DisInfo
The pointer to the block of symbolic information for above call back.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
#define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref
#define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref
static MCSymbolRefExpr::VariantKind getVariant(uint64_t LLVMDisassembler_VariantKind)
Base class for the full range of assembler expressions which are needed for parsing.
unsigned getReg() const
Returns the register number.
#define LLVMDisassembler_VariantKind_ARM64_PAGEOFF
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
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...
#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP
#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui
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_SymbolStub
#define LLVMDisassembler_VariantKind_None
The operand VariantKinds for symbolic disassembly.
struct LLVMOpInfoSymbol1 AddSymbol
struct LLVMOpInfoSymbol1 SubtractSymbol
#define LLVMDisassembler_ReferenceType_In_Branch
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static const MCUnaryExpr * createMinus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
#define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr
raw_ostream & write_escaped(StringRef Str, bool UseHexEscapes=false)
Output Str, turning '\', '', ' ', '"', and anything that doesn't satisfy llvm::isPrint into an escape...
const MCOperand & getOperand(unsigned i) const
#define LLVMDisassembler_VariantKind_ARM64_GOTPAGEOFF
#define LLVMDisassembler_VariantKind_ARM64_TLVP
uint16_t getEncodingValue(unsigned RegNo) const
Returns the encoding for RegNo.
#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
#define LLVMDisassembler_VariantKind_ARM64_GOTPAGE
#define LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr
const MCRegisterInfo * getRegisterInfo() const
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.
#define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref
#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri
unsigned getOpcode() const
#define LLVMDisassembler_VariantKind_ARM64_PAGE
The ARM64 target VariantKinds.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
LLVMSymbolLookupCallback SymbolLookUp
The function to lookup a symbol name.