retdec
Public Member Functions | Public Attributes | Private Member Functions | Friends | List of all members
retdec::bin2llvmir::EqSet Class Reference

#include <simple_types.h>

Collaboration diagram for retdec::bin2llvmir::EqSet:
Collaboration graph
[legend]

Public Member Functions

 EqSet (std::size_t id)
 
void insert (Config *config, llvm::Value *v, eSourcePriority p=eSourcePriority::PRIORITY_NONE)
 
void insert (llvm::Type *t, eSourcePriority p=eSourcePriority::PRIORITY_NONE)
 
void propagate (llvm::Module *module)
 
void apply (llvm::Module *module, Config *config, FileImage *objf, std::unordered_set< llvm::Instruction * > &instToErase)
 

Public Attributes

const std::size_t id
 Each instance gets its own unique ID for debug print purposes. More...
 
TypeEntry masterType
 Type of an entire equivalence set. More...
 
ValueEntrySet valSet
 Values in the set. More...
 
TypeEntrySet typeSet
 This allows to add certain types to set without having a value for them. More...
 
EquationEntrySet equationSet
 

Private Member Functions

llvm::Type * getHigherPriorityType (llvm::Module *module, llvm::Type *t1, llvm::Type *t2)
 
llvm::Type * getHigherPriorityTypePrivate (llvm::Module *module, llvm::Type *t1, llvm::Type *t2, std::unordered_set< llvm::Type * > &seen)
 

Friends

std::ostream & operator<< (std::ostream &out, const EqSet &eq)
 

Detailed Description

Equivalence set – object in set have to same type.

Constructor & Destructor Documentation

◆ EqSet()

retdec::bin2llvmir::EqSet::EqSet ( std::size_t  id)

Member Function Documentation

◆ apply()

void retdec::bin2llvmir::EqSet::apply ( llvm::Module *  module,
Config config,
FileImage objf,
std::unordered_set< llvm::Instruction * > &  instToErase 
)

◆ getHigherPriorityType()

Type * retdec::bin2llvmir::EqSet::getHigherPriorityType ( llvm::Module *  module,
llvm::Type *  t1,
llvm::Type *  t2 
)
private

◆ getHigherPriorityTypePrivate()

llvm::Type * retdec::bin2llvmir::EqSet::getHigherPriorityTypePrivate ( llvm::Module *  module,
llvm::Type *  t1,
llvm::Type *  t2,
std::unordered_set< llvm::Type * > &  seen 
)
private

This method defines ordering of types. It takes 2 types and return a 'higher' of them.

Parameters
moduleModule used to get bitsize of type values.
t1First type.
t2Second type.
seenSet of all already seen types. Used to protect itself against infinite recursion.
Returns
Higher of the two types, or first of them if they are equal.

◆ insert() [1/2]

void retdec::bin2llvmir::EqSet::insert ( Config config,
llvm::Value *  v,
eSourcePriority  p = eSourcePriority::PRIORITY_NONE 
)

◆ insert() [2/2]

void retdec::bin2llvmir::EqSet::insert ( llvm::Type *  t,
eSourcePriority  p = eSourcePriority::PRIORITY_NONE 
)

◆ propagate()

void retdec::bin2llvmir::EqSet::propagate ( llvm::Module *  module)

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const EqSet eq 
)
friend

Member Data Documentation

◆ equationSet

EquationEntrySet retdec::bin2llvmir::EqSet::equationSet

This allows to propagate type to another equivalence set, which may not have the same type as this set. E.g. this=pointer(other).

◆ id

const std::size_t retdec::bin2llvmir::EqSet::id

Each instance gets its own unique ID for debug print purposes.

◆ masterType

TypeEntry retdec::bin2llvmir::EqSet::masterType

Type of an entire equivalence set.

◆ typeSet

TypeEntrySet retdec::bin2llvmir::EqSet::typeSet

This allows to add certain types to set without having a value for them.

◆ valSet

ValueEntrySet retdec::bin2llvmir::EqSet::valSet

Values in the set.


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