Predator  [unstable] git snapshot
Namespaces | Data Structures | Typedefs | Enumerations | Functions
CodeStorage Namespace Reference

object model that describes the analyzed code on the input More...

Namespaces

namespace  CallGraph
namespace  PointsTo
namespace  VarKiller

Data Structures

struct  Var
 high-level variable representation More...
class  VarDb
 lookup container for set of Var objects More...
class  TypeDb
 type lookup table More...
struct  NameDb
 name to UID mapping for global/static symbols More...
struct  KillVar
 value type describing a single 'kill variable' hint More...
struct  ltKillVar
 FIXME: inserting <id,0> and <id,1> could break the consistency of std::set. More...
struct  Insn
 high-level representation of an intermediate code instruction More...
class  Block
 Basic block - a single node in ControlFlow graph. More...
class  ControlFlow
 Control flow graph - an easy to analyse representation of the intermediate code. More...
struct  Fnc
 function definition More...
class  FncDb
 lookup container for set of Fnc objects More...
struct  Storage
 a value type representing the whole serialised model of code More...

Typedefs

typedef struct cl_operand[] TOperandList
 generic STL-based list of cl_operand objects.
typedef const BlockTTargetList
 generic STL-based list of Block pointers (useful to build CFG from Block objects)
typedef std::set< KillVar,
ltKillVar
TKillVarList
 list of variables to kill (a kill list)
typedef std::vector< TKillVarListTKillPerTarget
 list of kill lists (one per each target of a terminal instruction)
typedef std::vector< int > TArgByPos
typedef std::set< int > TVarSet
typedef std::vector< const Fnc * > TFncList
typedef std::vector< const Insn * > TInsnList
typedef std::map< Fnc
*, TInsnList
TInsnListByFnc

Enumerations

enum  EVar {
  VAR_VOID,
  VAR_GL,
  VAR_LC,
  VAR_FNC_ARG
}
 high-level variable (operand) classification More...

Functions

std::ostream & operator<< (std::ostream &str, const Insn &in)
void killLocalVariables (Storage &stor)
bool isOnStack (const Var &)
void readTypeTree (TypeDb &db, const struct cl_type *clt)
 Add the given type into TypeDb instance, then descent into the type and add all the referred types recursively.
const char * nameOf (const Fnc &)
 return the name of given Fnc object (if any)
struct cl_loclocationOf (const Fnc &)
 return the location info associated with the given Fnc object (if any)
int uidOf (const Fnc &)
 return the uid of given Fnc object
bool isDefined (const Fnc &)
 return true if the function is defined (means we have its CFG and the like)
const FncfncByCfg (const ControlFlow *cfg)
 return the pointer to the Fnc object that the cfg instance is wrapped by

Detailed Description

object model that describes the analyzed code on the input

Typedef Documentation

typedef std::vector<int> TArgByPos

Definition at line 609 of file storage.hh.

typedef std::vector<const Fnc *> TFncList

Definition at line 819 of file storage.hh.

typedef std::vector<const Insn *> TInsnList

Definition at line 820 of file storage.hh.

typedef std::map<Fnc *, TInsnList> TInsnListByFnc

Definition at line 821 of file storage.hh.

typedef std::vector<TKillVarList> TKillPerTarget

list of kill lists (one per each target of a terminal instruction)

Definition at line 324 of file storage.hh.

typedef std::set<KillVar, ltKillVar> TKillVarList

list of variables to kill (a kill list)

Definition at line 321 of file storage.hh.

typedef struct cl_operand [] TOperandList

generic STL-based list of cl_operand objects.

They may or may not be deep-cloned, it depends on the particular purpose.

Definition at line 288 of file storage.hh.

typedef const Block* TTargetList

generic STL-based list of Block pointers (useful to build CFG from Block objects)

Definition at line 294 of file storage.hh.

typedef std::set<int> TVarSet

Definition at line 610 of file storage.hh.

Enumeration Type Documentation

enum EVar

high-level variable (operand) classification

Enumerator:
VAR_VOID 

this should be used only internally

VAR_GL 

global (may be also static) variable

VAR_LC 

local variable (not valid beyond a function)

VAR_FNC_ARG 

fnc argument (sort of local variable also)

Definition at line 53 of file storage.hh.

Function Documentation

const Fnc* CodeStorage::fncByCfg ( const ControlFlow *  cfg)

return the pointer to the Fnc object that the cfg instance is wrapped by

bool CodeStorage::isDefined ( const Fnc &  )

return true if the function is defined (means we have its CFG and the like)

bool CodeStorage::isOnStack ( const Var &  )
void CodeStorage::killLocalVariables ( Storage &  stor)
struct cl_loc* CodeStorage::locationOf ( const Fnc &  )
read

return the location info associated with the given Fnc object (if any)

const char* CodeStorage::nameOf ( const Fnc &  )

return the name of given Fnc object (if any)

std::ostream& CodeStorage::operator<< ( std::ostream &  str,
const Insn &  in 
)
inline

Definition at line 58 of file cldebug.hh.

References insnToStream().

void CodeStorage::readTypeTree ( TypeDb &  db,
const struct cl_type clt 
)

Add the given type into TypeDb instance, then descent into the type and add all the referred types recursively.

Parameters
dbTypeDb object to add all types to
cltan arbitrary code listener type to be read
int CodeStorage::uidOf ( const Fnc &  )

return the uid of given Fnc object