43 !GetOpInfo(DisInfo, Address, Offset, InstSize, 1, &SymbolicOp)) {
48 uint64_t ReferenceType;
53 const char *ReferenceName;
54 const char *
Name = SymbolLookUp(DisInfo, Value, &ReferenceType, Address,
65 cStream <<
"symbol stub for: " << ReferenceName;
67 cStream <<
"Objc message: " << ReferenceName;
68 if (!Name && !IsBranch)
95 if (SymbolicOp.
Value != 0)
144 const char *ReferenceName;
145 (void)SymbolLookUp(DisInfo, Value, &ReferenceType, Address, &ReferenceName);
147 cStream <<
"literal pool symbol address: " << ReferenceName;
148 else if(ReferenceType ==
150 cStream <<
"literal pool for: \"" << ReferenceName <<
"\"";
151 else if(ReferenceType ==
153 cStream <<
"Objc cfstring ref: @\"" << ReferenceName <<
"\"";
154 else if(ReferenceType ==
156 cStream <<
"Objc message: " << ReferenceName;
157 else if(ReferenceType ==
159 cStream <<
"Objc message ref: " << ReferenceName;
160 else if(ReferenceType ==
162 cStream <<
"Objc selector ref: " << ReferenceName;
163 else if(ReferenceType ==
165 cStream <<
"Objc class ref: " << ReferenceName;
175 assert(Ctx != 0 &&
"No MCContext given for symbolic disassembly");
179 SymbolLookUp, DisInfo);
static const MCConstantExpr * Create(int64_t Value, MCContext &Ctx)
const char *(* LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName)
#define LLVMDisassembler_ReferenceType_In_Branch
static MCOperand CreateExpr(const MCExpr *Val)
Symbolize using user-provided, C API, callbacks.
MCSymbolizer * createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, MCRelocationInfo *RelInfo)
#define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref
#define LLVMDisassembler_ReferenceType_Out_SymbolStub
MCSymbol * GetOrCreateSymbol(StringRef Name)
#define LLVMDisassembler_ReferenceType_InOut_None
static const MCBinaryExpr * CreateSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &CommentStream, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize)
Try to add a symbolic operand instead of Value to the MCInst.
#define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref
static const MCSymbolRefExpr * Create(const MCSymbol *Symbol, MCContext &Ctx)
Symbolize and annotate disassembled instructions.
OwningPtr< MCRelocationInfo > RelInfo
#define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr
Create MCExprs from relocations found in an object file.
struct LLVMOpInfoSymbol1 AddSymbol
struct LLVMOpInfoSymbol1 SubtractSymbol
#define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref
#define LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr
void tryAddingPcLoadReferenceComment(raw_ostream &CommentStream, int64_t Value, uint64_t Address)
Try to add a comment on the PC-relative load. For instance, in Mach-O, this is used to add annotation...
#define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref
static const MCBinaryExpr * CreateAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCUnaryExpr * CreateMinus(const MCExpr *Expr, MCContext &Ctx)
#define LLVMDisassembler_ReferenceType_In_PCrel_Load
LLVM Value Representation.
void addOperand(const MCOperand &Op)
int(* LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBuf)
#define LLVMDisassembler_ReferenceType_Out_Objc_Message