retdec
Public Member Functions | Private Member Functions | List of all members
retdec::bin2llvmir::AbiX86 Class Reference

#include <x86.h>

Inheritance diagram for retdec::bin2llvmir::AbiX86:
Inheritance graph
[legend]
Collaboration diagram for retdec::bin2llvmir::AbiX86:
Collaboration graph
[legend]

Public Member Functions

 AbiX86 (llvm::Module *m, Config *c)
 
virtual bool isGeneralPurposeRegister (const llvm::Value *val) const override
 
virtual bool isNopInstruction (cs_insn *insn) override
 
- Public Member Functions inherited from retdec::bin2llvmir::Abi
 Abi (llvm::Module *m, Config *c)
 
virtual ~Abi ()=default
 
bool isRegister (const llvm::Value *val) const
 
bool isRegister (const llvm::Value *val, uint32_t r) const
 
bool isFlagRegister (const llvm::Value *val)
 
bool isStackPointerRegister (const llvm::Value *val) const
 
bool isZeroRegister (const llvm::Value *val)
 
llvm::GlobalVariable * getRegister (uint32_t r, bool use=true) const
 
uint32_t getRegisterId (const llvm::Value *r) const
 
const std::vector< llvm::GlobalVariable * > & getRegisters () const
 
llvm::GlobalVariable * getStackPointerRegister () const
 
llvm::GlobalVariable * getZeroRegister () const
 
std::size_t getRegisterByteSize (uint32_t r) const
 
void addRegister (uint32_t id, llvm::GlobalVariable *reg)
 
llvm::GlobalVariable * getSyscallIdRegister ()
 
llvm::GlobalVariable * getSyscallReturnRegister ()
 
llvm::GlobalVariable * getSyscallArgumentRegister (unsigned n)
 
bool isStackVariable (const llvm::Value *val) const
 
bool isNopInstruction (AsmInstruction ai)
 
virtual std::size_t getTypeByteSize (llvm::Type *t) const
 
virtual std::size_t getTypeBitSize (llvm::Type *t) const
 
llvm::IntegerType * getDefaultType () const
 
llvm::PointerType * getDefaultPointerType () const
 
std::size_t getWordSize () const
 
bool isMips () const
 
bool isMips64 () const
 
bool isArm () const
 
bool isArm64 () const
 
bool isX86 () const
 
bool isX64 () const
 
bool isPowerPC () const
 
bool isPowerPC64 () const
 
bool isPic32 () const
 
bool supportsCallingConvention (const CallingConvention::ID &cc)
 
CallingConventiongetCallingConvention (const CallingConvention::ID &cc)
 
CallingConventiongetDefaultCallingConvention ()
 
CallingConvention::ID getDefaultCallingConventionID () const
 
ConfiggetConfig () const
 

Private Member Functions

CallingConvention::ID fetchDefaultCC () const
 

Additional Inherited Members

- Static Public Member Functions inherited from retdec::bin2llvmir::Abi
static std::size_t getTypeByteSize (llvm::Module *m, llvm::Type *t)
 
static std::size_t getTypeBitSize (llvm::Module *m, llvm::Type *t)
 
static llvm::IntegerType * getDefaultType (llvm::Module *m)
 
static llvm::Type * getDefaultFPType (llvm::Module *m)
 
static llvm::PointerType * getDefaultPointerType (llvm::Module *m)
 
static std::size_t getWordSize (llvm::Module *m)
 
- Static Public Attributes inherited from retdec::bin2llvmir::Abi
static const uint32_t REG_INVALID = 0
 
static const unsigned DEFAULT_ADDR_SPACE = 0
 
- Protected Attributes inherited from retdec::bin2llvmir::Abi
llvm::Module * _module = nullptr
 
Config_config = nullptr
 
std::vector< llvm::GlobalVariable * > _regs
 
std::vector< llvm::GlobalVariable * > _id2regs
 Fast "capstone id -> LLVM value" search. More...
 
std::map< const llvm::Value *, uint32_t > _regs2id
 
uint32_t _regStackPointerId = REG_INVALID
 ID of stack pointer register. More...
 
uint32_t _regFunctionReturnId = REG_INVALID
 ID of register where function return values are stored. More...
 
std::vector< uint32_t > _syscallRegs
 Ordered list of registers used in system calls. More...
 
uint32_t _regSyscallReturn = REG_INVALID
 Register used for returning values from system calls. More...
 
uint32_t _regSyscallId = REG_INVALID
 Register used to pass system call ID. More...
 
uint32_t _regZeroReg = REG_INVALID
 Register that is always equal to zero - not every arch have this. More...
 
std::map< CallingConvention::ID, CallingConvention::Ptr_id2cc
 
CallingConvention::ID _defcc
 

Constructor & Destructor Documentation

◆ AbiX86()

retdec::bin2llvmir::AbiX86::AbiX86 ( llvm::Module *  m,
Config c 
)

Member Function Documentation

◆ fetchDefaultCC()

CallingConvention::ID retdec::bin2llvmir::AbiX86::fetchDefaultCC ( ) const
private

◆ isGeneralPurposeRegister()

bool retdec::bin2llvmir::AbiX86::isGeneralPurposeRegister ( const llvm::Value *  val) const
overridevirtual

◆ isNopInstruction()

bool retdec::bin2llvmir::AbiX86::isNopInstruction ( cs_insn *  insn)
overridevirtual

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