30#ifndef INCLUDE_SVFIR_SVFTYPE_H_
31#define INCLUDE_SVFIR_SVFTYPE_H_
60 std::vector<const SVFType*>
finfo;
222 virtual void print(std::ostream&
os)
const = 0;
288 void print(std::ostream&
os)
const override;
306 void print(std::ostream&
os)
const override;
341 void print(std::ostream&
os)
const override;
361 void print(std::ostream&
os)
const override;
397 void print(std::ostream&
os)
const override;
448 void print(std::ostream&
os)
const override;
466#if !defined NDBUG && defined USE_SVF_DBOUT
471# define SVF_DEBUG_WITH_TYPE(TYPE, X) \
477# define SVF_DEBUG_WITH_TYPE(TYPE, X) \
484#define DBOUT(TYPE, X) SVF_DEBUG_WITH_TYPE(TYPE, X)
486#define DOTIMESTAT(X) X
490#define DGENERAL "general"
492#define DPAGBuild "pag"
493#define DMemModel "mm"
494#define DMemModelCE "mmce"
495#define DCOMModel "comm"
497#define DDumpPT "dumppt"
498#define DRefinePT "sbpt"
499#define DCache "cache"
502#define DInstrument "ins"
503#define DAndersen "ander"
504#define DSaber "saber"
512#define TIMEINTERVAL 1000
513#define CLOCK_IN_MS() (clock() / (CLOCKS_PER_SEC / TIMEINTERVAL))
516#define NATIVE_INT_SIZE (sizeof(unsigned long long) * CHAR_BIT)
536template <>
struct std::hash<
SVF::NodePair>
544 uint32_t first = (uint32_t)(
p.first);
545 uint32_t second = (uint32_t)(
p.second);
546 return ((uint64_t)(first) << 32) | (uint64_t)(second);
551template <
unsigned N>
struct std::hash<
SVF::SparseBitVector<N>>
561template <
typename T>
struct std::hash<std::vector<T>>
571 h ^= hf(t) + 0x9e3779b9 + (h << 6) + (h >> 2);
const std::string structName
const SVFType * getTypeOfElement() const
const SVFType * typeOfElement
For printing & debugging.
SVFArrayType(u32_t byteSize=1)
For printing & debugging.
void setTypeOfElement(const SVFType *elemType)
void setNumOfElement(unsigned elemNum)
static bool classof(const SVFType *node)
void print(std::ostream &os) const override
const SVFType * getReturnType() const
static bool classof(const SVFType *node)
SVFFunctionType(const SVFType *rt)
void print(std::ostream &os) const override
SVFIntegerType(u32_t byteSize=1)
short signAndWidth
For printing.
void print(std::ostream &os) const override
void setSignAndWidth(short sw)
static bool classof(const SVFType *node)
const std::string & getRepr()
void print(std::ostream &os) const override
void setRepr(std::string &&r)
static bool classof(const SVFType *node)
void setRepr(const std::string &r)
SVFOtherType(bool isSingleValueTy, u32_t byteSize=1)
Field representation for printing.
static bool classof(const SVFType *node)
SVFPointerType(u32_t byteSize=1)
void print(std::ostream &os) const override
std::string name
Field for printing & debugging.
static bool classof(const SVFType *node)
void setName(const std::string &structName)
SVFStructType(u32_t byteSize=1)
void print(std::ostream &os) const override
void setName(std::string &&structName)
const std::string & getName()
const StInfo * getTypeInfo() const
SVFType(bool svt, SVFTyKind k, u32_t Sz=1)
GNodeK kind
used for classof
static SVFType * getSVFPtrType()
bool isSingleValueType() const
static SVFType * svfPtrTy
ptr type
StInfo * typeinfo
SVF's TypeInfo.
std::string toString() const
u32_t getByteSize() const
static SVFType * svfI8Ty
8-bit int type
bool isSingleValTy
The type represents a single value, not struct or.
static SVFType * getSVFInt8Type()
void setTypeInfo(StInfo *ti)
virtual void print(std::ostream &os) const =0
void operator=(const StInfo &)=delete
const SVFType * getOriginalElemType(u32_t fldIdx) const
std::vector< const SVFType * > & getFlattenElementTypes()
const std::vector< u32_t > & getFlattenedElemIdxVec() const
void setNumOfFieldsAndElems(u32_t nf, u32_t ne)
Set number of fields and elements of an aggregate.
std::vector< u32_t > & getFlattenedElemIdxVec()
StInfo()=delete
Max field limit.
u32_t getNumOfFlattenElements() const
Return number of elements after flattening (including array elements)
std::vector< const SVFType * > & getFlattenFieldTypes()
~StInfo()=default
Destructor.
std::vector< u32_t > fldIdxVec
flattened field indices of a struct (ignoring arrays)
u32_t numOfFlattenElements
number of elements after flattening (including array elements)
std::vector< u32_t > elemIdxVec
StInfo(u32_t s)
Constructor.
StInfo(const StInfo &st)=delete
u32_t numOfFlattenFields
number of fields after flattening (ignoring array elements)
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.
std::vector< const SVFType * > flattenElementTypes
Type vector of fields.
const std::vector< const SVFType * > & getFlattenElementTypes() const
std::vector< u32_t > & getFlattenedFieldIdxVec()
const std::vector< u32_t > & getFlattenedFieldIdxVec() const
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 getNumOfFlattenFields() const
Return the number of fields after flattening (ignoring array elements)
u32_t getStride() const
Return the stride.
llvm::IRBuilder IRBuilder
std::pair< NodeID, NodeID > NodePair
IntervalValue operator<<(const IntervalValue &lhs, const IntervalValue &rhs)
Left binary shift of IntervalValues.
size_t operator()(const NodePair &p) const
provide extra hash function for std::pair handling
size_t operator()(const SVF::NodePair &p) const
size_t operator()(const SVF::SparseBitVector< N > &sbv) const
size_t operator()(const std::vector< T > &v) const