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

#include <stack.h>

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

Public Member Functions

 StackAnalysis ()
 
virtual bool runOnModule (llvm::Module &m) override
 
bool runOnModuleCustom (llvm::Module &m, Config *c, Abi *abi, DebugFormat *dbgf=nullptr)
 

Static Public Attributes

static char ID = 0
 

Private Member Functions

bool run ()
 
void handleInstruction (ReachingDefinitionsAnalysis &RDA, llvm::Instruction *inst, llvm::Value *val, llvm::Type *type, std::map< llvm::Value *, llvm::Value * > &val2val)
 
std::optional< int > getBaseOffset (SymbolicTree &root)
 
const retdec::common::ObjectgetDebugStackVariable (llvm::Function *fnc, SymbolicTree &root)
 
const retdec::common::ObjectgetConfigStackVariable (llvm::Function *fnc, SymbolicTree &root)
 

Private Attributes

llvm::Module * _module = nullptr
 
Config_config = nullptr
 
Abi_abi = nullptr
 
DebugFormat_dbgf = nullptr
 
std::unordered_set< llvm::Value * > _toRemove
 

Constructor & Destructor Documentation

◆ StackAnalysis()

retdec::bin2llvmir::StackAnalysis::StackAnalysis ( )

Member Function Documentation

◆ getBaseOffset()

std::optional< int > retdec::bin2llvmir::StackAnalysis::getBaseOffset ( SymbolicTree root)
private

◆ getConfigStackVariable()

const retdec::common::Object * retdec::bin2llvmir::StackAnalysis::getConfigStackVariable ( llvm::Function *  fnc,
SymbolicTree root 
)
private

◆ getDebugStackVariable()

const retdec::common::Object * retdec::bin2llvmir::StackAnalysis::getDebugStackVariable ( llvm::Function *  fnc,
SymbolicTree root 
)
private

Find a value that is being added to the stack pointer register in root. Find a debug variable with offset equal to this value.

◆ handleInstruction()

void retdec::bin2llvmir::StackAnalysis::handleInstruction ( ReachingDefinitionsAnalysis RDA,
llvm::Instruction *  inst,
llvm::Value *  val,
llvm::Type *  type,
std::map< llvm::Value *, llvm::Value * > &  val2val 
)
private

◆ run()

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

◆ runOnModule()

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

◆ runOnModuleCustom()

bool retdec::bin2llvmir::StackAnalysis::runOnModuleCustom ( llvm::Module &  m,
Config c,
Abi abi,
DebugFormat dbgf = nullptr 
)

Member Data Documentation

◆ _abi

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

◆ _config

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

◆ _dbgf

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

◆ _module

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

◆ _toRemove

std::unordered_set<llvm::Value*> retdec::bin2llvmir::StackAnalysis::_toRemove
private

◆ ID

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

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