Static Value-Flow Analysis
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
SVF::SVFType Class Referenceabstract

#include <SVFType.h>

Inheritance diagram for SVF::SVFType:
SVF::SVFArrayType SVF::SVFFunctionType SVF::SVFIntegerType SVF::SVFOtherType SVF::SVFPointerType SVF::SVFStructType

Public Types

enum  SVFTyKind {
  SVFTy , SVFPointerTy , SVFIntegerTy , SVFFunctionTy ,
  SVFStructTy , SVFArrayTy , SVFOtherTy
}
 
typedef s64_t GNodeK
 

Public Member Functions

 SVFType (void)=delete
 
virtual ~SVFType ()
 
GNodeK getKind () const
 
std::string toString () const
 
virtual void print (std::ostream &os) const =0
 
void setTypeInfo (StInfo *ti)
 
StInfogetTypeInfo ()
 
const StInfogetTypeInfo () const
 
u32_t getByteSize () const
 
bool isPointerTy () const
 
bool isArrayTy () const
 
bool isStructTy () const
 
bool isSingleValueType () const
 

Static Public Member Functions

static SVFTypegetSVFPtrType ()
 
static SVFTypegetSVFInt8Type ()
 

Protected Member Functions

 SVFType (bool svt, SVFTyKind k, u32_t Sz=1)
 

Private Attributes

GNodeK kind
 used for classof More...
 
StInfotypeinfo
 SVF's TypeInfo. More...
 
bool isSingleValTy
 The type represents a single value, not struct or. More...
 
u32_t byteSize
 array More...
 

Static Private Attributes

static SVFTypesvfPtrTy = nullptr
 ptr type More...
 
static SVFTypesvfI8Ty = nullptr
 8-bit int type More...
 

Friends

class SVFIRWriter
 
class SVFIRReader
 
class LLVMModuleSet
 

Detailed Description

Definition at line 156 of file SVFType.h.

Member Typedef Documentation

◆ GNodeK

Definition at line 163 of file SVFType.h.

Member Enumeration Documentation

◆ SVFTyKind

Enumerator
SVFTy 
SVFPointerTy 
SVFIntegerTy 
SVFFunctionTy 
SVFStructTy 
SVFArrayTy 
SVFOtherTy 

Definition at line 165 of file SVFType.h.

166  {
167  SVFTy,
168  SVFPointerTy,
169  SVFIntegerTy,
171  SVFStructTy,
172  SVFArrayTy,
173  SVFOtherTy,
174  };
@ SVFFunctionTy
Definition: SVFType.h:170
@ SVFIntegerTy
Definition: SVFType.h:169
@ SVFPointerTy
Definition: SVFType.h:168

Constructor & Destructor Documentation

◆ SVFType() [1/2]

SVF::SVFType::SVFType ( bool  svt,
SVFTyKind  k,
u32_t  Sz = 1 
)
inlineprotected

Definition at line 203 of file SVFType.h.

204  : kind(k), typeinfo(nullptr),
205  isSingleValTy(svt), byteSize(Sz)
206  {
207  }
GNodeK kind
used for classof
Definition: SVFType.h:196
u32_t byteSize
array
Definition: SVFType.h:199
StInfo * typeinfo
SVF's TypeInfo.
Definition: SVFType.h:197
bool isSingleValTy
The type represents a single value, not struct or.
Definition: SVFType.h:198

◆ SVFType() [2/2]

SVF::SVFType::SVFType ( void  )
delete

◆ ~SVFType()

virtual SVF::SVFType::~SVFType ( )
inlinevirtual

Definition at line 211 of file SVFType.h.

211 {}

Member Function Documentation

◆ getByteSize()

u32_t SVF::SVFType::getByteSize ( ) const
inline

if Type is not sized, byteSize is 0 if Type is sized, byteSize is the LLVM Byte Size.

Definition at line 244 of file SVFType.h.

245  {
246  return byteSize;
247  }

◆ getKind()

GNodeK SVF::SVFType::getKind ( void  ) const
inline

Definition at line 213 of file SVFType.h.

214  {
215  return kind;
216  }

◆ getSVFInt8Type()

static SVFType* SVF::SVFType::getSVFInt8Type ( )
inlinestatic

Definition at line 184 of file SVFType.h.

185  {
186  assert(svfI8Ty && "int8 type not set?");
187  return svfI8Ty;
188  }
static SVFType * svfI8Ty
8-bit int type
Definition: SVFType.h:193

◆ getSVFPtrType()

static SVFType* SVF::SVFType::getSVFPtrType ( )
inlinestatic

Definition at line 178 of file SVFType.h.

179  {
180  assert(svfPtrTy && "ptr type not set?");
181  return svfPtrTy;
182  }
static SVFType * svfPtrTy
ptr type
Definition: SVFType.h:192

◆ getTypeInfo() [1/2]

StInfo* SVF::SVFType::getTypeInfo ( )
inline

Definition at line 230 of file SVFType.h.

231  {
232  assert(typeinfo && "set the type info first");
233  return typeinfo;
234  }

◆ getTypeInfo() [2/2]

const StInfo* SVF::SVFType::getTypeInfo ( ) const
inline

Definition at line 236 of file SVFType.h.

237  {
238  assert(typeinfo && "set the type info first");
239  return typeinfo;
240  }

◆ isArrayTy()

bool SVF::SVFType::isArrayTy ( ) const
inline

Definition at line 254 of file SVFType.h.

255  {
256  return kind == SVFArrayTy;
257  }

◆ isPointerTy()

bool SVF::SVFType::isPointerTy ( ) const
inline

Definition at line 249 of file SVFType.h.

250  {
251  return kind == SVFPointerTy;
252  }

◆ isSingleValueType()

bool SVF::SVFType::isSingleValueType ( ) const
inline

Definition at line 264 of file SVFType.h.

265  {
266  return isSingleValTy;
267  }

◆ isStructTy()

bool SVF::SVFType::isStructTy ( ) const
inline

Definition at line 259 of file SVFType.h.

260  {
261  return kind == SVFStructTy;
262  }

◆ print()

virtual void SVF::SVFType::print ( std::ostream &  os) const
pure virtual

◆ setTypeInfo()

void SVF::SVFType::setTypeInfo ( StInfo ti)
inline

Definition at line 225 of file SVFType.h.

226  {
227  typeinfo = ti;
228  }

◆ toString()

std::string SVF::SVFType::toString ( ) const
Note
Use os<<svfType or svfType.print(os) when possible to avoid string concatenation.

Friends And Related Function Documentation

◆ LLVMModuleSet

friend class LLVMModuleSet
friend

Definition at line 160 of file SVFType.h.

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 159 of file SVFType.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 158 of file SVFType.h.

Member Data Documentation

◆ byteSize

u32_t SVF::SVFType::byteSize
private

array

LLVM Byte Size

Definition at line 199 of file SVFType.h.

◆ isSingleValTy

bool SVF::SVFType::isSingleValTy
private

The type represents a single value, not struct or.

Definition at line 198 of file SVFType.h.

◆ kind

GNodeK SVF::SVFType::kind
private

used for classof

Definition at line 196 of file SVFType.h.

◆ svfI8Ty

SVFType * SVF::SVFType::svfI8Ty = nullptr
staticprivate

8-bit int type

Definition at line 193 of file SVFType.h.

◆ svfPtrTy

SVFType * SVF::SVFType::svfPtrTy = nullptr
staticprivate

ptr type

Definition at line 192 of file SVFType.h.

◆ typeinfo

StInfo* SVF::SVFType::typeinfo
private

SVF's TypeInfo.

Definition at line 197 of file SVFType.h.


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