30#ifndef INCLUDE_SVFIR_SYMBOLTABLEINFO_H_
31#define INCLUDE_SVFIR_SYMBOLTABLEINFO_H_
217 svfVal =
g->getDefGlobalForMultipleModule();
225 IDToMemMapTy::const_iterator
iter =
objMap.find(
id);
349 assert(
false &&
"this type info has been added before");
407 virtual const std::string
toString()
const;
bool isConstantStruct() const
const SVFType * getType() const
Get obj type.
bool isConstDataOrConstGlobal() const
bool operator==(const MemObj &mem) const
Operator overloading.
void destroy()
Clean up memory.
const SVFValue * refVal
The unique value of this symbol/variable.
bool isConstDataOrAggData() const
SymID symId
The unique id to represent this symbol.
SymID getId() const
Get the memory object id.
bool isFieldInsensitive() const
Return true if its field limit is 0.
const SVFBaseNode * gNode
u32_t getMaxFieldOffsetLimit() const
Get max field offset limit.
virtual const std::string toString() const
ObjTypeInfo * typeInfo
Type information of this object.
const SVFBaseNode * getGNode() const
Get the reference value to this object.
bool isBlackHoleObj() const
Whether it is a black hole object.
bool isConstantArray() const
const SVFValue * getValue() const
Get the reference value to this object.
void setNumOfElements(u32_t num)
Set the number of elements of this object.
virtual ~MemObj()
Destructor.
void setFieldSensitive()
Set the memory object to be field sensitive (up to max field limit)
u32_t getNumOfElements() const
Get the number of elements of this object.
void setFieldInsensitive()
Set the memory object to be field insensitive.
u32_t getByteSizeOfObj() const
Get the byte size of this object.
bool isFunction() const
object attributes methods
bool isConstantByteSize() const
Check if byte size is a const value.
const SVFType * type
SVF type.
u32_t elemNum
Size of the object or number of elements.
bool isConstDataOrAggData()
u32_t getMaxFieldOffsetLimit()
Get max field offset limit.
bool hasFlag(MEMTYPE mask)
bool isConstDataOrConstGlobal()
u32_t getNumOfElements() const
Get the number of elements of this object.
const SVFType * getType() const
Get LLVM type.
bool isConstantByteSize() const
Check if byte size is a const value.
void setMaxFieldOffsetLimit(u32_t limit)
Get max field offset limit.
u32_t byteSize
Byte size of object.
void setByteSizeOfObj(u32_t size)
Set the byte size of this object.
bool isFunction()
Object attributes.
virtual ~ObjTypeInfo()
Destructor.
u32_t getByteSizeOfObj() const
Get the byte size of this object.
void setFlag(MEMTYPE mask)
Flag for this object type.
void resetTypeForHeapStaticObj(const SVFType *type)
void setNumOfElements(u32_t num)
Set the number of elements of this object.
ValueToIDMapTy & valSyms()
Get different kinds of syms maps.
SymID blackholeSymID() const
const SVFType * maxStruct
The struct type with the most fields.
SymID totalSymNum
total number of symbols
SymID blkPtrSymID() const
void printFlattenFields(const SVFType *type)
Debug method.
const std::vector< const SVFType * > & getFlattenFieldTypes(const SVFStructType *T)
Return the flattened field type for struct type only.
u32_t getFlattenedElemIdx(const SVFType *T, u32_t origId)
Flattened element idx of an array or struct by considering stride.
static SymbolTableInfo * SymbolInfo()
Singleton design here to make sure we only have one instance during any analysis.
u32_t getTotalSymNum() const
Statistics.
ObjTypeInfo * createObjTypeInfo(const SVFType *type)
Create an objectInfo based on LLVM type (value is null, and type could be null, representing a dummy ...
static bool isBlkObjOrConstantObj(NodeID id)
const SVFTypeSet & getSVFTypes() const
Constant reader that won't change the state of the symbol table.
FunToIDMapTy & varargSyms()
ValueToIDMapTy & objSyms()
const SVFType * getOriginalElemType(const SVFType *baseType, u32_t origId) const
void setModelConstants(bool _modelConstants)
Set / Get modelConstants.
void setModule(SVFModule *m)
Module.
static SymbolTableInfo * symInfo
ValueToIDMapTy valSymMap
map a value to its sym id
virtual APOffset getModulusOffset(const MemObj *obj, const APOffset &apOffset)
Given an offset from a Gep Instruction, return it modulus offset by considering memory layout.
ValueToIDMapTy objSymMap
map a obj reference to its sym id
const StInfo * getTypeInfo(const SVFType *T) const
Get struct info.
const Set< const StInfo * > & getStInfos() const
SymID getVarargSym(const SVFFunction *val) const
virtual ~SymbolTableInfo()
static bool isConstantObj(NodeID id)
void addStInfo(StInfo *stInfo)
SymID getValSym(const SVFValue *val)
Get different kinds of syms.
MemObj * getBlkObj() const
SymID getObjSym(const SVFValue *val) const
static std::string toString(SYMTYPE symtype)
const SVFType * getFlatternedElemType(const SVFType *baseType, u32_t flatten_idx)
Return the type of a flattened element given a flattened index.
u32_t getNumOfFlattenElements(const SVFType *T)
Number of flattened elements of an array or struct.
OrderedMap< SymID, MemObj * > IDToMemMapTy
sym id to memory object map
void destroy()
Clean up memory.
Set< const SVFType * > SVFTypeSet
struct type to struct info map
bool getModelConstants() const
void addTypeInfo(const SVFType *ty)
FunToIDMapTy varargSymMap
vararg map
Set< const StInfo * > stInfos
(owned) All StInfo
virtual void dump()
Another debug method.
static void releaseSymbolInfo()
MemObj * getConstantObj() const
SymID constantSymID() const
const IDToMemMapTy & idToObjMap() const
u32_t maxStSize
The number of fields in max_struct.
u32_t getMaxStructSize() const
static bool isBlkPtr(NodeID id)
special value
OrderedMap< const SVFFunction *, SymID > FunToIDMapTy
function to sym id map
IDToMemMapTy & idToObjMap()
static bool isNullPtr(NodeID id)
OrderedMap< const SVFValue *, SymID > ValueToIDMapTy
various maps defined
MemObj * getObj(SymID id) const
bool modelConstants
Whether to model constants.
static bool isBlkObj(NodeID id)
SymID nullPtrSymID() const
const MemObj * createDummyObj(SymID symId, const SVFType *type)
Can only be invoked by SVFIR::addDummyNode() when creating SVFIR from file.
FunToIDMapTy returnSymMap
return map
IDToMemMapTy objMap
map a memory sym id to its obj
SVFModule * getModule()
Module.
bool hasValSym(const SVFValue *val)
bool hasSVFTypeInfo(const SVFType *T)
SymID getRetSym(const SVFFunction *val) const
SymbolTableInfo(void)
Constructor.
llvm::IRBuilder IRBuilder