LLVM  8.0.1
Public Member Functions | List of all members
llvm::AArch64ExternalSymbolizer Class Reference

#include "Target/AArch64/Disassembler/AArch64ExternalSymbolizer.h"

Inheritance diagram for llvm::AArch64ExternalSymbolizer:
Inheritance graph
[legend]
Collaboration diagram for llvm::AArch64ExternalSymbolizer:
Collaboration graph
[legend]

Public Member Functions

 AArch64ExternalSymbolizer (MCContext &Ctx, std::unique_ptr< MCRelocationInfo > RelInfo, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo)
 
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 immediate Value in the MCInst. More...
 
- Public Member Functions inherited from llvm::MCExternalSymbolizer
 MCExternalSymbolizer (MCContext &Ctx, std::unique_ptr< MCRelocationInfo > RelInfo, LLVMOpInfoCallback getOpInfo, LLVMSymbolLookupCallback symbolLookUp, void *disInfo)
 
void tryAddingPcLoadReferenceComment (raw_ostream &CommentStream, int64_t Value, uint64_t Address) override
 Try to add a comment on the PC-relative load. More...
 
- Public Member Functions inherited from llvm::MCSymbolizer
 MCSymbolizer (MCContext &Ctx, std::unique_ptr< MCRelocationInfo > RelInfo)
 Construct an MCSymbolizer, taking ownership of RelInfo. More...
 
 MCSymbolizer (const MCSymbolizer &)=delete
 
MCSymbolizeroperator= (const MCSymbolizer &)=delete
 
virtual ~MCSymbolizer ()
 

Additional Inherited Members

- Protected Attributes inherited from llvm::MCExternalSymbolizer
LLVMOpInfoCallback GetOpInfo
 
LLVMSymbolLookupCallback SymbolLookUp
 The function to lookup a symbol name. More...
 
void * DisInfo
 The pointer to the block of symbolic information for above call back. More...
 
- Protected Attributes inherited from llvm::MCSymbolizer
MCContextCtx
 
std::unique_ptr< MCRelocationInfoRelInfo
 

Detailed Description

Definition at line 21 of file AArch64ExternalSymbolizer.h.

Constructor & Destructor Documentation

◆ AArch64ExternalSymbolizer()

llvm::AArch64ExternalSymbolizer::AArch64ExternalSymbolizer ( MCContext Ctx,
std::unique_ptr< MCRelocationInfo RelInfo,
LLVMOpInfoCallback  GetOpInfo,
LLVMSymbolLookupCallback  SymbolLookUp,
void *  DisInfo 
)
inline

Definition at line 23 of file AArch64ExternalSymbolizer.h.

References llvm::Address, MI, and tryAddingSymbolicOperand().

Member Function Documentation

◆ tryAddingSymbolicOperand()

bool AArch64ExternalSymbolizer::tryAddingSymbolicOperand ( MCInst MI,
raw_ostream CommentStream,
int64_t  Value,
uint64_t  Address,
bool  IsBranch,
uint64_t  Offset,
uint64_t  InstSize 
)
overridevirtual

tryAddingSymbolicOperand - tryAddingSymbolicOperand trys to add a symbolic operand in place of the immediate Value in the MCInst.

The immediate Value has not had any PC adjustment made by the caller. If the instruction is a branch that adds the PC to the immediate Value then isBranch is Success, else Fail. If GetOpInfo is non-null, then it is called to get any symbolic information at the Address for this instrution. If that returns non-zero then the symbolic information it returns is used to create an MCExpr and that is added as an operand to the MCInst. If GetOpInfo() returns zero and isBranch is Success then a symbol look up for Address + Value is done and if a symbol is found an MCExpr is created with that, else an MCExpr with Address + Value is created. If GetOpInfo() returns zero and isBranch is Fail then the Opcode of the MCInst is tested and for ADRP an other instructions that help to load of pointers a symbol look up is done to see it is returns a specific reference type to add to the comment stream. This function returns Success if it adds an operand to the MCInst and Fail otherwise.

Reimplemented from llvm::MCExternalSymbolizer.

Definition at line 60 of file AArch64ExternalSymbolizer.cpp.

References llvm::MCID::Add, llvm::MCInst::addOperand(), LLVMOpInfo1::AddSymbol, llvm::AArch64ISD::ADR, llvm::AArch64ISD::ADRP, llvm::MCConstantExpr::create(), llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createAdd(), llvm::MCOperand::createExpr(), llvm::MCUnaryExpr::createMinus(), llvm::MCBinaryExpr::createSub(), llvm::MCSymbolizer::Ctx, llvm::MCExternalSymbolizer::DisInfo, llvm::format(), llvm::MCRegisterInfo::getEncodingValue(), llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCExternalSymbolizer::GetOpInfo, llvm::MCContext::getOrCreateSymbol(), llvm::MCOperand::getReg(), llvm::MCContext::getRegisterInfo(), getVariant(), LLVMDisassembler_ReferenceType_In_ARM64_ADDXri, LLVMDisassembler_ReferenceType_In_ARM64_ADR, LLVMDisassembler_ReferenceType_In_ARM64_ADRP, LLVMDisassembler_ReferenceType_In_ARM64_LDRXl, LLVMDisassembler_ReferenceType_In_ARM64_LDRXui, LLVMDisassembler_ReferenceType_In_Branch, LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr, LLVMDisassembler_ReferenceType_Out_LitPool_SymAddr, LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref, LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref, LLVMDisassembler_ReferenceType_Out_Objc_Message, LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref, LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref, LLVMDisassembler_ReferenceType_Out_SymbolStub, llvm::Intrinsic::memset, LLVMOpInfoSymbol1::Name, Name, LLVMOpInfoSymbol1::Present, LLVMOpInfo1::SubtractSymbol, llvm::MCExternalSymbolizer::SymbolLookUp, LLVMOpInfoSymbol1::Value, LLVMOpInfo1::Value, LLVMOpInfo1::VariantKind, llvm::MCSymbolRefExpr::VK_None, and llvm::raw_ostream::write_escaped().

Referenced by AArch64ExternalSymbolizer().


The documentation for this class was generated from the following files: