SVF
|
#include <SymbolTableInfo.h>
Public Member Functions | |
LocSymTableInfo () | |
Constructor. More... | |
virtual | ~LocSymTableInfo () |
Destructor. More... | |
virtual bool | computeGepOffset (const User *V, LocationSet &ls) |
Compute gep offset. More... | |
virtual LocationSet | getModulusOffset (const MemObj *obj, const LocationSet &ls) |
Given an offset from a Gep Instruction, return it modulus offset by considering memory layout. More... | |
void | verifyStructSize (StInfo *stInfo, u32_t structSize) |
Verify struct size construction. More... | |
![]() | |
SVFModule * | getModule () |
Module. More... | |
void | buildMemModel (SVFModule *svfModule) |
Start building memory model. More... | |
const Type * | getBaseTypeAndFlattenedFields (const Value *V, std::vector< LocationSet > &fields) |
Get the base type and max offset. More... | |
u32_t | getFields (std::vector< LocationSet > &fields, const Type *T, u32_t msz) |
Replace fields with flatten fields of T if the number of its fields is larger than msz. More... | |
void | collectTypeInfo (const Type *T) |
Collect type info. More... | |
void | printFlattenFields (const Type *type) |
Debug method. More... | |
virtual void | dump () |
Another debug method. More... | |
void | setModelConstants (bool _modelConstants) |
Set / Get modelConstants. More... | |
bool | getModelConstants () const |
const CallSiteSet & | getCallSiteSet () const |
Get callsite set. More... | |
u32_t | getTypeSizeInBytes (const Type *type) |
Helper method to get the size of the type from target data layout. More... | |
u32_t | getTypeSizeInBytes (const StructType *sty, u32_t field_index) |
void | collectSym (const Value *val) |
collect the syms More... | |
void | collectVal (const Value *val) |
void | collectObj (const Value *val) |
void | collectRet (const Function *val) |
void | collectVararg (const Function *val) |
void | handleGlobalCE (const GlobalVariable *G) |
Handle constant expression. More... | |
void | handleGlobalInitializerCE (const Constant *C, u32_t offset) |
void | handleCE (const Value *val) |
SymID | getValSym (const Value *val) |
Get different kinds of syms. More... | |
bool | hasValSym (const Value *val) |
const Value * | getGlobalRep (const Value *val) const |
find the unique defined global across multiple modules More... | |
SymID | getObjSym (const Value *val) const |
MemObj * | getObj (SymID id) const |
SymID | getRetSym (const Function *val) const |
SymID | getVarargSym (const Function *val) const |
Size_t | getTotalSymNum () const |
Statistics. More... | |
u32_t | getMaxStructSize () const |
ValueToIDMapTy & | valSyms () |
Get different kinds of syms maps. More... | |
ValueToIDMapTy & | objSyms () |
IDToMemMapTy & | idToObjMap () |
FunToIDMapTy & | retSyms () |
FunToIDMapTy & | varargSyms () |
TypeToFieldInfoMap::iterator | getStructInfoIter (const Type *T) |
Get struct info. More... | |
StInfo * | getStructInfo (const Type *T) |
Get a reference to StructInfo. More... | |
const std::vector< u32_t > & | getFattenFieldIdxVec (const Type *T) |
Get a reference to the components of struct_info. More... | |
const std::vector< u32_t > & | getFattenFieldOffsetVec (const Type *T) |
const std::vector< FieldInfo > & | getFlattenFieldInfoVec (const Type *T) |
const Type * | getOrigSubTypeWithFldInx (const Type *baseType, u32_t field_idx) |
const Type * | getOrigSubTypeWithByteOffset (const Type *baseType, u32_t byteOffset) |
virtual | ~SymbolTableInfo () |
bool | isConstantObjSym (const Value *val) |
void | createBlkOrConstantObj (SymID symId) |
MemObj * | getBlkObj () const |
MemObj * | getConstantObj () const |
SymID | blkPtrSymID () const |
SymID | nullPtrSymID () const |
SymID | constantSymID () const |
SymID | blackholeSymID () const |
const MemObj * | createDummyObj (SymID symId, const Type *type) |
Can only be invoked by PAG::addDummyNode() when creaing PAG from file. More... | |
Protected Member Functions | |
virtual void | collectStructInfo (const StructType *T) |
Collect the struct info. More... | |
virtual void | collectArrayInfo (const ArrayType *T) |
Collect the array info. More... | |
![]() | |
SymbolTableInfo (void) | |
Constructor. More... | |
virtual void | collectSimpleTypeInfo (const Type *T) |
Collect simple type (non-aggregate) info. More... | |
Additional Inherited Members | |
![]() | |
typedef OrderedMap< const Value *, SymID > | ValueToIDMapTy |
various maps defined More... | |
typedef OrderedMap< SymID, MemObj * > | IDToMemMapTy |
sym id to memory object map More... | |
typedef OrderedMap< const Function *, SymID > | FunToIDMapTy |
function to sym id map More... | |
typedef OrderedMap< SymID, SYMTYPE > | IDToSymTyMapTy |
sym id to sym type map More... | |
typedef OrderedMap< const Type *, StInfo * > | TypeToFieldInfoMap |
struct type to struct info map More... | |
typedef Set< CallSite > | CallSiteSet |
typedef OrderedMap< const Instruction *, CallSiteID > | CallSiteToIDMapTy |
typedef OrderedMap< CallSiteID, const Instruction * > | IDToCallSiteMapTy |
![]() | |
static DataLayout * | getDataLayout (Module *mod) |
Get target machine data layout. More... | |
static std::string | toString (SYMTYPE symtype) |
static SymbolTableInfo * | SymbolInfo () |
Singleton design here to make sure we only have one instance during any analysis. More... | |
static void | releaseSymbolInfo () |
static bool | isNullPtrSym (const Value *val) |
special value More... | |
static bool | isBlackholeSym (const Value *val) |
static bool | isBlkPtr (NodeID id) |
static bool | isNullPtr (NodeID id) |
static bool | isBlkObj (NodeID id) |
static bool | isConstantObj (NodeID id) |
static bool | isBlkObjOrConstantObj (NodeID id) |
![]() | |
TypeToFieldInfoMap | typeToFieldInfo |
const Type * | maxStruct |
The struct type with the most fields. More... | |
u32_t | maxStSize |
The number of fields in max_struct. More... | |
Bytes/bits-level modeling of memory locations to handle weakly type languages. (declared with one type but accessed as another) Abstract memory objects are created according to the static allocated size.
Definition at line 460 of file SymbolTableInfo.h.
|
inline |
|
inlinevirtual |
|
protectedvirtual |
Collect the array info.
Collect array information
Reimplemented from SVF::SymbolTableInfo.
Definition at line 400 of file MemModel.cpp.
|
protectedvirtual |
Collect the struct info.
Reimplemented from SVF::SymbolTableInfo.
Definition at line 443 of file MemModel.cpp.
|
virtual |
Compute gep offset.
Compute gep offset
variant offset
Reimplemented from SVF::SymbolTableInfo.
Definition at line 305 of file MemModel.cpp.
|
virtual |
Given an offset from a Gep Instruction, return it modulus offset by considering memory layout.
Given LocationSet from a Gep Instruction, return a new LocationSet which matches the field information of this ObjTypeInfo by considering memory layout
Find an appropriate field for this LocationSet
This location set represent one object
if the offset is negative, it's possible that we're looking for an obj node out of range of current struct. Make the offset positive so we can still get a node within current struct to represent this obj.
This location set represents multiple objects
Reimplemented from SVF::SymbolTableInfo.
Definition at line 493 of file MemModel.cpp.
Verify struct size construction.
Verify struct size
Please note this verify may not be complete as different machine has different alignment mechanism
Definition at line 577 of file MemModel.cpp.