LLVM: llvm::AArch64ExternalSymbolizer Class Reference (original) (raw)

Definition at line 20 of file AArch64ExternalSymbolizer.h.

tryAddingSymbolicOperand - tryAddingSymbolicOperand tries 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 instruction. 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.

Implements llvm::MCSymbolizer.

Definition at line 60 of file AArch64ExternalSymbolizer.cpp.

References llvm::Add, llvm::Address, LLVMOpInfo1::AddSymbol, 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(), getMachOSpecifier(), llvm::MCExternalSymbolizer::GetOpInfo, 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, MI, LLVMOpInfoSymbol1::Name, llvm::Offset, LLVMOpInfoSymbol1::Present, llvm::AArch64::S_None, llvm::Sub, LLVMOpInfo1::SubtractSymbol, llvm::MCExternalSymbolizer::SymbolLookUp, LLVMOpInfo1::Value, LLVMOpInfoSymbol1::Value, LLVMOpInfo1::VariantKind, and llvm::raw_ostream::write_escaped().