Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
SVF::StInfo Class Reference

#include <SVFType.h>

Public Member Functions

 StInfo ()=delete
 Max field limit.
 
 StInfo (const StInfo &st)=delete
 
void operator= (const StInfo &)=delete
 
 StInfo (u32_t s)
 Constructor.
 
 ~StInfo ()=default
 Destructor.
 
const SVFTypegetOriginalElemType (u32_t fldIdx) const
 
std::vector< u32_t > & getFlattenedFieldIdxVec ()
 
std::vector< u32_t > & getFlattenedElemIdxVec ()
 
std::vector< const SVFType * > & getFlattenElementTypes ()
 
std::vector< const SVFType * > & getFlattenFieldTypes ()
 
const std::vector< u32_t > & getFlattenedFieldIdxVec () const
 
const std::vector< u32_t > & getFlattenedElemIdxVec () const
 
const std::vector< const SVFType * > & getFlattenElementTypes () const
 
const std::vector< const SVFType * > & getFlattenFieldTypes () const
 
void addFldWithType (u32_t fldIdx, const SVFType *type, u32_t elemIdx)
 Add field index and element index and their corresponding type.
 
void setNumOfFieldsAndElems (u32_t nf, u32_t ne)
 Set number of fields and elements of an aggregate.
 
u32_t getNumOfFlattenElements () const
 Return number of elements after flattening (including array elements)
 
u32_t getNumOfFlattenFields () const
 Return the number of fields after flattening (ignoring array elements)
 
u32_t getStride () const
 Return the stride.
 

Protected Member Functions

 StInfo (u32_t id, std::vector< u32_t > fldIdxVec, std::vector< u32_t > elemIdxVec, Map< u32_t, const SVFType * > fldIdx2TypeMap, std::vector< const SVFType * > finfo, u32_t stride, u32_t numOfFlattenElements, u32_t numOfFlattenFields, std::vector< const SVFType * > flattenElementTypes)
 
const u32_t getStinfoId () const
 
const Map< u32_t, const SVFType * > & getFldIdx2TypeMap () const
 
void setStinfoId (u32_t id)
 

Private Attributes

u32_t StInfoId
 
std::vector< u32_tfldIdxVec
 flattened field indices of a struct (ignoring arrays)
 
std::vector< u32_telemIdxVec
 
Map< u32_t, const SVFType * > fldIdx2TypeMap
 Types of all fields of a struct.
 
std::vector< const SVFType * > finfo
 All field infos after flattening a struct.
 
u32_t stride
 
u32_t numOfFlattenElements
 number of elements after flattening (including array elements)
 
u32_t numOfFlattenFields
 number of fields after flattening (ignoring array elements)
 
std::vector< const SVFType * > flattenElementTypes
 Type vector of fields.
 

Friends

class GraphDBClient
 
class IRGraph
 

Detailed Description

Flattened type information of StructType, ArrayType and SingleValueType

Definition at line 46 of file SVFType.h.

Constructor & Destructor Documentation

◆ StInfo() [1/4]

SVF::StInfo::StInfo ( u32_t  id,
std::vector< u32_t fldIdxVec,
std::vector< u32_t elemIdxVec,
Map< u32_t, const SVFType * >  fldIdx2TypeMap,
std::vector< const SVFType * >  finfo,
u32_t  stride,
u32_t  numOfFlattenElements,
u32_t  numOfFlattenFields,
std::vector< const SVFType * >  flattenElementTypes 
)
inlineprotected

Definition at line 53 of file SVFType.h.

57 {
58
59 }
u32_t stride
Definition SVFType.h:89
std::vector< u32_t > fldIdxVec
flattened field indices of a struct (ignoring arrays)
Definition SVFType.h:79
u32_t numOfFlattenElements
number of elements after flattening (including array elements)
Definition SVFType.h:91
std::vector< u32_t > elemIdxVec
Definition SVFType.h:82
u32_t StInfoId
Definition SVFType.h:77
u32_t numOfFlattenFields
number of fields after flattening (ignoring array elements)
Definition SVFType.h:93
std::vector< const SVFType * > flattenElementTypes
Type vector of fields.
Definition SVFType.h:95
Map< u32_t, const SVFType * > fldIdx2TypeMap
Types of all fields of a struct.
Definition SVFType.h:84
std::vector< const SVFType * > finfo
All field infos after flattening a struct.
Definition SVFType.h:86

◆ StInfo() [2/4]

SVF::StInfo::StInfo ( )
delete

Max field limit.

◆ StInfo() [3/4]

SVF::StInfo::StInfo ( const StInfo st)
delete

◆ StInfo() [4/4]

SVF::StInfo::StInfo ( u32_t  s)
inlineexplicit

Constructor.

Definition at line 104 of file SVFType.h.

106 {
107 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~StInfo()

SVF::StInfo::~StInfo ( )
default

Destructor.

Member Function Documentation

◆ addFldWithType()

void SVF::StInfo::addFldWithType ( u32_t  fldIdx,
const SVFType type,
u32_t  elemIdx 
)

Add field index and element index and their corresponding type.

◆ getFlattenedElemIdxVec() [1/2]

std::vector< u32_t > & SVF::StInfo::getFlattenedElemIdxVec ( )
inline

Definition at line 125 of file SVFType.h.

126 {
127 return elemIdxVec;
128 }

◆ getFlattenedElemIdxVec() [2/2]

const std::vector< u32_t > & SVF::StInfo::getFlattenedElemIdxVec ( ) const
inline

Definition at line 141 of file SVFType.h.

142 {
143 return elemIdxVec;
144 }

◆ getFlattenedFieldIdxVec() [1/2]

std::vector< u32_t > & SVF::StInfo::getFlattenedFieldIdxVec ( )
inline

Definition at line 121 of file SVFType.h.

122 {
123 return fldIdxVec;
124 }

◆ getFlattenedFieldIdxVec() [2/2]

const std::vector< u32_t > & SVF::StInfo::getFlattenedFieldIdxVec ( ) const
inline

Definition at line 137 of file SVFType.h.

138 {
139 return fldIdxVec;
140 }

◆ getFlattenElementTypes() [1/2]

std::vector< const SVFType * > & SVF::StInfo::getFlattenElementTypes ( )
inline

Definition at line 129 of file SVFType.h.

130 {
131 return flattenElementTypes;
132 }

◆ getFlattenElementTypes() [2/2]

const std::vector< const SVFType * > & SVF::StInfo::getFlattenElementTypes ( ) const
inline

Definition at line 145 of file SVFType.h.

146 {
147 return flattenElementTypes;
148 }

◆ getFlattenFieldTypes() [1/2]

std::vector< const SVFType * > & SVF::StInfo::getFlattenFieldTypes ( )
inline

Definition at line 133 of file SVFType.h.

134 {
135 return finfo;
136 }

◆ getFlattenFieldTypes() [2/2]

const std::vector< const SVFType * > & SVF::StInfo::getFlattenFieldTypes ( ) const
inline

Definition at line 149 of file SVFType.h.

150 {
151 return finfo;
152 }

◆ getFldIdx2TypeMap()

const Map< u32_t, const SVFType * > & SVF::StInfo::getFldIdx2TypeMap ( ) const
inlineprotected

Definition at line 66 of file SVFType.h.

67 {
68 return fldIdx2TypeMap;
69 }

◆ getNumOfFlattenElements()

u32_t SVF::StInfo::getNumOfFlattenElements ( ) const
inline

Return number of elements after flattening (including array elements)

Definition at line 166 of file SVFType.h.

167 {
169 }

◆ getNumOfFlattenFields()

u32_t SVF::StInfo::getNumOfFlattenFields ( ) const
inline

Return the number of fields after flattening (ignoring array elements)

Definition at line 172 of file SVFType.h.

173 {
174 return numOfFlattenFields;
175 }

◆ getOriginalElemType()

const SVFType * StInfo::getOriginalElemType ( u32_t  fldIdx) const

struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;

OriginalFieldType of b with field_idx 1 : Struct A FlatternedFieldType of b with field_idx 1 : int

Definition at line 68 of file SVFValue.cpp.

69{
71 if(it!=fldIdx2TypeMap.end())
72 return it->second;
73 return nullptr;
74}
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map

◆ getStinfoId()

const u32_t SVF::StInfo::getStinfoId ( ) const
inlineprotected

Definition at line 61 of file SVFType.h.

62 {
63 return StInfoId;
64 }

◆ getStride()

u32_t SVF::StInfo::getStride ( ) const
inline

Return the stride.

Definition at line 177 of file SVFType.h.

178 {
179 return stride;
180 }

◆ operator=()

void SVF::StInfo::operator= ( const StInfo )
delete

◆ setNumOfFieldsAndElems()

void SVF::StInfo::setNumOfFieldsAndElems ( u32_t  nf,
u32_t  ne 
)
inline

Set number of fields and elements of an aggregate.

Definition at line 159 of file SVFType.h.

160 {
163 }

◆ setStinfoId()

void SVF::StInfo::setStinfoId ( u32_t  id)
inlineprotected

Definition at line 71 of file SVFType.h.

72 {
73 StInfoId = id;
74 }

Friends And Related Symbol Documentation

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 49 of file SVFType.h.

◆ IRGraph

Definition at line 50 of file SVFType.h.

Member Data Documentation

◆ elemIdxVec

std::vector<u32_t> SVF::StInfo::elemIdxVec
private

flattened element indices including structs and arrays by considering strides

Definition at line 82 of file SVFType.h.

◆ finfo

std::vector<const SVFType*> SVF::StInfo::finfo
private

All field infos after flattening a struct.

Definition at line 86 of file SVFType.h.

◆ flattenElementTypes

std::vector<const SVFType*> SVF::StInfo::flattenElementTypes
private

Type vector of fields.

Definition at line 95 of file SVFType.h.

◆ fldIdx2TypeMap

Map<u32_t, const SVFType*> SVF::StInfo::fldIdx2TypeMap
private

Types of all fields of a struct.

Definition at line 84 of file SVFType.h.

◆ fldIdxVec

std::vector<u32_t> SVF::StInfo::fldIdxVec
private

flattened field indices of a struct (ignoring arrays)

Definition at line 79 of file SVFType.h.

◆ numOfFlattenElements

u32_t SVF::StInfo::numOfFlattenElements
private

number of elements after flattening (including array elements)

Definition at line 91 of file SVFType.h.

◆ numOfFlattenFields

u32_t SVF::StInfo::numOfFlattenFields
private

number of fields after flattening (ignoring array elements)

Definition at line 93 of file SVFType.h.

◆ StInfoId

u32_t SVF::StInfo::StInfoId
private

Definition at line 77 of file SVFType.h.

◆ stride

u32_t SVF::StInfo::stride
private

stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.

Definition at line 89 of file SVFType.h.


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