30#ifndef INCLUDE_SVFIR_SVFTYPE_H_
31#define INCLUDE_SVFIR_SVFTYPE_H_
58 std::vector<const SVFType*>
finfo;
219 virtual void print(std::ostream&
os)
const = 0;
288 void print(std::ostream&
os)
const override;
304 void print(std::ostream&
os)
const override;
351 void print(std::ostream&
os)
const override;
373 void print(std::ostream&
os)
const override;
412 void print(std::ostream&
os)
const override;
461 void print(std::ostream&
os)
const override;
479#if !defined NDBUG && defined USE_SVF_DBOUT
484# define SVF_DEBUG_WITH_TYPE(TYPE, X) \
490# define SVF_DEBUG_WITH_TYPE(TYPE, X) \
497#define DBOUT(TYPE, X) SVF_DEBUG_WITH_TYPE(TYPE, X)
499#define DOTIMESTAT(X) X
503#define DGENERAL "general"
505#define DPAGBuild "pag"
506#define DMemModel "mm"
507#define DMemModelCE "mmce"
508#define DCOMModel "comm"
510#define DDumpPT "dumppt"
511#define DRefinePT "sbpt"
512#define DCache "cache"
515#define DInstrument "ins"
516#define DAndersen "ander"
517#define DSaber "saber"
525#define TIMEINTERVAL 1000
526#define CLOCK_IN_MS() (clock() / (CLOCKS_PER_SEC / TIMEINTERVAL))
529#define NATIVE_INT_SIZE (sizeof(unsigned long long) * CHAR_BIT)
549template <>
struct std::hash<
SVF::NodePair>
557 uint32_t first = (uint32_t)(
p.first);
558 uint32_t second = (uint32_t)(
p.second);
559 return ((uint64_t)(first) << 32) | (uint64_t)(second);
564template <
unsigned N>
struct std::hash<
SVF::SparseBitVector<N>>
574template <
typename T>
struct std::hash<std::vector<T>>
584 h ^= hf(t) + 0x9e3779b9 + (h << 6) + (h >> 2);
const std::string structName
const SVFType * getTypeOfElement() const
const SVFType * typeOfElement
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
SVFArrayType(u32_t i, u32_t byteSize=1)
For printing & debugging.
const SVFType * getReturnType() const
static bool classof(const SVFType *node)
SVFFunctionType(u32_t i, const SVFType *rt, const std::vector< const SVFType * > &p, bool isvararg)
const std::vector< const SVFType * > & getParamTypes() const
std::vector< const SVFType * > params
void print(std::ostream &os) const override
short signAndWidth
For printing.
void print(std::ostream &os) const override
SVFIntegerType(u32_t i, u32_t byteSize=1)
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(u32_t i, bool isSingleValueTy, u32_t byteSize=1)
Field representation for printing.
static bool classof(const SVFType *node)
SVFPointerType(u32_t i, 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)
std::vector< const SVFType * > fields
const std::vector< const SVFType * > & getFieldTypes() const
void print(std::ostream &os) const override
void setName(std::string &&structName)
const std::string & getName()
SVFStructType(u32_t i, std::vector< const SVFType * > &f, u32_t byteSize=1)
const StInfo * getTypeInfo() const
GNodeK kind
used for classof
u32_t byteSize
LLVM Byte Size.
static SVFType * getSVFPtrType()
bool isSingleValueType() const
SVFType(bool svt, SVFTyKind k, u32_t i=0, u32_t Sz=1)
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 addFldWithType(u32_t fldIdx, const SVFType *type, u32_t elemIdx)
Add field index and element index and their corresponding type.
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
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