Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::SVFStructType Class Reference

#include <SVFType.h>

Inheritance diagram for SVF::SVFStructType:
SVF::SVFType

Public Member Functions

 SVFStructType (u32_t i, std::vector< const SVFType * > &f, u32_t byteSize=1)
void print (std::ostream &os) const override
const std::string & getName ()
void setName (const std::string &structName)
void setName (std::string &&structName)
const std::vector< const SVFType * > & getFieldTypes () const
Public Member Functions inherited from SVF::SVFType
 SVFType (void)=delete
virtual ~SVFType ()
GNodeK getKind () const
std::string toString () const
u32_t getId () const
void setTypeInfo (StInfo *ti)
StInfo * getTypeInfo ()
const StInfo * getTypeInfo () const
u32_t getByteSize () const
bool isPointerTy () const
bool isArrayTy () const
bool isStructTy () const
bool isSingleValueType () const

Static Public Member Functions

static bool classof (const SVFType *node)
Static Public Member Functions inherited from SVF::SVFType
static SVFType * getSVFPtrType ()
static SVFType * getSVFInt8Type ()

Protected Member Functions

const std::string & getName () const
void addFieldsType (const SVFType *type)
Protected Member Functions inherited from SVF::SVFType
 SVFType (bool svt, SVFTyKind k, u32_t i=0, u32_t Sz=1)

Private Attributes

std::string name
 Field for printing & debugging.
std::vector< const SVFType * > fields

Friends

class GraphDBClient

Additional Inherited Members

Public Types inherited from SVF::SVFType
enum  SVFTyKind {
  SVFTy , SVFPointerTy , SVFIntegerTy , SVFFunctionTy ,
  SVFStructTy , SVFArrayTy , SVFOtherTy
}
typedef s64_t GNodeK
Static Protected Member Functions inherited from SVF::SVFType
static void setSVFPtrType (SVFType *ptrTy)
 set svfptrty and svfi8ty when initializing SVFType from db query results
static void setSVFInt8Type (SVFType *i8Ty)

Detailed Description

Definition at line 419 of file SVFType.h.

Constructor & Destructor Documentation

◆ SVFStructType()

SVF::SVFStructType::SVFStructType ( u32_t i,
std::vector< const SVFType * > & f,
u32_t byteSize = 1 )
inline

Definition at line 441 of file SVFType.h.

441 :
442 SVFType(false, SVFStructTy, i, byteSize), fields(f)
443 {
444 }
std::vector< const SVFType * > fields
Definition SVFType.h:438
u32_t byteSize
LLVM Byte Size.
Definition SVFType.h:237
SVFType(void)=delete

Member Function Documentation

◆ addFieldsType()

void SVF::SVFStructType::addFieldsType ( const SVFType * type)
inlineprotected

Definition at line 430 of file SVFType.h.

431 {
432 fields.push_back(type);
433 }
newitem type
Definition cJSON.cpp:2739

◆ classof()

bool SVF::SVFStructType::classof ( const SVFType * node)
inlinestatic

Definition at line 446 of file SVFType.h.

447 {
448 return node->getKind() == SVFStructTy;
449 }

◆ getFieldTypes()

const std::vector< const SVFType * > & SVF::SVFStructType::getFieldTypes ( ) const
inline

Definition at line 467 of file SVFType.h.

468 {
469 return fields;
470 }

◆ getName() [1/2]

const std::string & SVF::SVFStructType::getName ( )
inline

Definition at line 453 of file SVFType.h.

454 {
455 return name;
456 }
std::string name
Field for printing & debugging.
Definition SVFType.h:437

◆ getName() [2/2]

const std::string & SVF::SVFStructType::getName ( ) const
inlineprotected

Definition at line 425 of file SVFType.h.

426 {
427 return name;
428 }

◆ print()

void SVF::SVFStructType::print ( std::ostream & os) const
overridevirtual

Implements SVF::SVFType.

Definition at line 64 of file SVFType.cpp.

65{
66 os << "S." << name << " {";
67
68 // Print fields
69 for (size_t i = 0; i < fields.size(); ++i)
70 {
71 os << *fields[i];
72 // Add comma after all fields except the last one
73 if (i != fields.size() - 1)
74 {
75 os << ", ";
76 }
77 }
78 os << "}";
79}

◆ setName() [1/2]

void SVF::SVFStructType::setName ( const std::string & structName)
inline

Definition at line 458 of file SVFType.h.

459 {
461 }
const std::string structName
Definition CppUtil.cpp:56

◆ setName() [2/2]

void SVF::SVFStructType::setName ( std::string && structName)
inline

Definition at line 462 of file SVFType.h.

463 {
464 name = std::move(structName);
465 }

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 421 of file SVFType.h.

Member Data Documentation

◆ fields

std::vector<const SVFType*> SVF::SVFStructType::fields
private

Definition at line 438 of file SVFType.h.

◆ name

std::string SVF::SVFStructType::name
private

Field for printing & debugging.

Definition at line 437 of file SVFType.h.


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