retdec
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
retdec::bin2llvmir::ParamReturn Class Reference

#include <param_return.h>

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

Public Member Functions

 ParamReturn ()
 
bool runOnModuleCustom (llvm::Module &m, Config *c, Abi *abi, Demangler *demangler, FileImage *img=nullptr, DebugFormat *dbgf=nullptr, Lti *lti=nullptr)
 
virtual bool runOnModule (llvm::Module &m) override
 

Static Public Attributes

static char ID = 0
 

Private Member Functions

bool run ()
 
void dumpInfo () const
 
void dumpInfo (const DataFlowEntry &de) const
 
void dumpInfo (const CallEntry &ce) const
 
void dumpInfo (const ReturnEntry &de) const
 
void collectAllCalls ()
 
DataFlowEntry createDataFlowEntry (llvm::Value *calledValue) const
 
void collectExtraData (DataFlowEntry *de) const
 
void collectExtraData (CallEntry *ce) const
 
void collectCallSpecificTypes (CallEntry *ce) const
 
common::CallingConventionID toCallConv (const std::string &cc) const
 
void addDataFromCall (DataFlowEntry *dataflow, llvm::CallInst *call) const
 
llvm::CallInst * getWrapper (llvm::Function *fnc) const
 
llvm::Type * extractType (llvm::Value *from) const
 
void filterCalls ()
 
void modifyType (DataFlowEntry &de) const
 
void analyzeWithDemangler (DataFlowEntry &de) const
 
void modifyWithDemangledData (DataFlowEntry &de, Demangler::FunctionPair &funcPair) const
 
void applyToIr ()
 
void applyToIr (DataFlowEntry &de)
 
void connectWrappers (const DataFlowEntry &de)
 
std::map< llvm::CallInst *, std::vector< llvm::Value * > > fetchLoadsOfCalls (const std::vector< CallEntry > &calls) const
 

Private Attributes

llvm::Module * _module = nullptr
 
Config_config = nullptr
 
Abi_abi = nullptr
 
FileImage_image = nullptr
 
DebugFormat_dbgf = nullptr
 
Lti_lti = nullptr
 
Demangler_demangler = nullptr
 
std::map< llvm::Value *, DataFlowEntry_fnc2calls
 
ReachingDefinitionsAnalysis _RDA
 
Collector::Ptr _collector
 

Constructor & Destructor Documentation

◆ ParamReturn()

retdec::bin2llvmir::ParamReturn::ParamReturn ( )

Member Function Documentation

◆ addDataFromCall()

void retdec::bin2llvmir::ParamReturn::addDataFromCall ( DataFlowEntry dataflow,
llvm::CallInst *  call 
) const
private

◆ analyzeWithDemangler()

void retdec::bin2llvmir::ParamReturn::analyzeWithDemangler ( DataFlowEntry de) const
private

◆ applyToIr() [1/2]

void retdec::bin2llvmir::ParamReturn::applyToIr ( )
private

◆ applyToIr() [2/2]

void retdec::bin2llvmir::ParamReturn::applyToIr ( DataFlowEntry de)
private

◆ collectAllCalls()

void retdec::bin2llvmir::ParamReturn::collectAllCalls ( )
private

Collect possible arguments' stores for all calls we want to analyze. At the moment, we analyze only indirect or declared function calls with no arguments inside one basic block.

◆ collectCallSpecificTypes()

void retdec::bin2llvmir::ParamReturn::collectCallSpecificTypes ( CallEntry ce) const
private

◆ collectExtraData() [1/2]

void retdec::bin2llvmir::ParamReturn::collectExtraData ( CallEntry ce) const
private

◆ collectExtraData() [2/2]

void retdec::bin2llvmir::ParamReturn::collectExtraData ( DataFlowEntry de) const
private

◆ connectWrappers()

void retdec::bin2llvmir::ParamReturn::connectWrappers ( const DataFlowEntry de)
private

◆ createDataFlowEntry()

DataFlowEntry retdec::bin2llvmir::ParamReturn::createDataFlowEntry ( llvm::Value *  calledValue) const
private

◆ dumpInfo() [1/4]

void retdec::bin2llvmir::ParamReturn::dumpInfo ( ) const
private

◆ dumpInfo() [2/4]

void retdec::bin2llvmir::ParamReturn::dumpInfo ( const CallEntry ce) const
private

◆ dumpInfo() [3/4]

void retdec::bin2llvmir::ParamReturn::dumpInfo ( const DataFlowEntry de) const
private

◆ dumpInfo() [4/4]

void retdec::bin2llvmir::ParamReturn::dumpInfo ( const ReturnEntry de) const
private

◆ extractType()

Type * retdec::bin2llvmir::ParamReturn::extractType ( llvm::Value *  from) const
private

◆ fetchLoadsOfCalls()

std::map< CallInst *, std::vector< Value * > > retdec::bin2llvmir::ParamReturn::fetchLoadsOfCalls ( const std::vector< CallEntry > &  calls) const
private

◆ filterCalls()

void retdec::bin2llvmir::ParamReturn::filterCalls ( )
private

◆ getWrapper()

CallInst * retdec::bin2llvmir::ParamReturn::getWrapper ( llvm::Function *  fnc) const
private

◆ modifyType()

void retdec::bin2llvmir::ParamReturn::modifyType ( DataFlowEntry de) const
private

◆ modifyWithDemangledData()

void retdec::bin2llvmir::ParamReturn::modifyWithDemangledData ( DataFlowEntry de,
Demangler::FunctionPair funcPair 
) const
private

◆ run()

bool retdec::bin2llvmir::ParamReturn::run ( )
private

◆ runOnModule()

bool retdec::bin2llvmir::ParamReturn::runOnModule ( llvm::Module &  m)
overridevirtual

◆ runOnModuleCustom()

bool retdec::bin2llvmir::ParamReturn::runOnModuleCustom ( llvm::Module &  m,
Config c,
Abi abi,
Demangler demangler,
FileImage img = nullptr,
DebugFormat dbgf = nullptr,
Lti lti = nullptr 
)

◆ toCallConv()

common::CallingConventionID retdec::bin2llvmir::ParamReturn::toCallConv ( const std::string &  cc) const
private

Member Data Documentation

◆ _abi

Abi* retdec::bin2llvmir::ParamReturn::_abi = nullptr
private

◆ _collector

Collector::Ptr retdec::bin2llvmir::ParamReturn::_collector
private

◆ _config

Config* retdec::bin2llvmir::ParamReturn::_config = nullptr
private

◆ _dbgf

DebugFormat* retdec::bin2llvmir::ParamReturn::_dbgf = nullptr
private

◆ _demangler

Demangler* retdec::bin2llvmir::ParamReturn::_demangler = nullptr
private

◆ _fnc2calls

std::map<llvm::Value*, DataFlowEntry> retdec::bin2llvmir::ParamReturn::_fnc2calls
private

◆ _image

FileImage* retdec::bin2llvmir::ParamReturn::_image = nullptr
private

◆ _lti

Lti* retdec::bin2llvmir::ParamReturn::_lti = nullptr
private

◆ _module

llvm::Module* retdec::bin2llvmir::ParamReturn::_module = nullptr
private

◆ _RDA

ReachingDefinitionsAnalysis retdec::bin2llvmir::ParamReturn::_RDA
private

◆ ID

char retdec::bin2llvmir::ParamReturn::ID = 0
static

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