Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
SVF::SVFFunctionType Class Reference

#include <SVFType.h>

Inheritance diagram for SVF::SVFFunctionType:
SVF::SVFType

Public Member Functions

 SVFFunctionType (u32_t i, const SVFType *rt, const std::vector< const SVFType * > &p, bool isvararg)
 
const SVFType * getReturnType () const
 
const std::vector< const SVFType * > & getParamTypes () const
 
bool isVarArg () const
 
void print (std::ostream &os) const override
 
- 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 void setReturnType (const SVFType *rt)
 
void addParamType (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

const SVFType * retTy
 
std::vector< const SVFType * > params
 
bool varArg
 

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 368 of file SVFType.h.

Constructor & Destructor Documentation

◆ SVFFunctionType()

SVF::SVFFunctionType::SVFFunctionType ( u32_t  i,
const SVFType *  rt,
const std::vector< const SVFType * > &  p,
bool  isvararg 
)
inline

Definition at line 392 of file SVFType.h.

393 : SVFType(false, SVFFunctionTy, i, 1), retTy(rt), params(p), varArg(isvararg)
394 {
395 }
cJSON * p
Definition cJSON.cpp:2559
const SVFType * retTy
Definition SVFType.h:373
std::vector< const SVFType * > params
Definition SVFType.h:374
SVFType(void)=delete
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

Member Function Documentation

◆ addParamType()

void SVF::SVFFunctionType::addParamType ( const SVFType *  type)
inlineprotected

Definition at line 386 of file SVFType.h.

387 {
388 params.push_back(type);
389 }
newitem type
Definition cJSON.cpp:2739

◆ classof()

static bool SVF::SVFFunctionType::classof ( const SVFType *  node)
inlinestatic

Definition at line 397 of file SVFType.h.

398 {
399 return node->getKind() == SVFFunctionTy;
400 }

◆ getParamTypes()

const std::vector< const SVFType * > & SVF::SVFFunctionType::getParamTypes ( ) const
inline

Definition at line 406 of file SVFType.h.

407 {
408 return params;
409 }

◆ getReturnType()

const SVFType * SVF::SVFFunctionType::getReturnType ( ) const
inline

Definition at line 401 of file SVFType.h.

402 {
403 return retTy;
404 }

◆ isVarArg()

bool SVF::SVFFunctionType::isVarArg ( ) const
inline

Definition at line 411 of file SVFType.h.

412 {
413 return varArg;
414 }

◆ print()

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

Implements SVF::SVFType.

Definition at line 36 of file SVFType.cpp.

37{
38 os << *getReturnType() << "(";
39
40 // Print parameters
41 for (size_t i = 0; i < params.size(); ++i)
42 {
43 os << *params[i];
44 // Add comma after all params except the last one
45 if (i != params.size() - 1)
46 {
47 os << ", ";
48 }
49 }
50
51 // Add varargs indicator if needed
52 if (isVarArg())
53 {
54 if (!params.empty())
55 {
56 os << ", ";
57 }
58 os << "...";
59 }
60
61 os << ")";
62}
const SVFType * getReturnType() const
Definition SVFType.h:401
bool isVarArg() const
Definition SVFType.h:411

◆ setReturnType()

const void SVF::SVFFunctionType::setReturnType ( const SVFType *  rt)
inlineprotected

Set return type of function, this is used when loading from DB

Definition at line 381 of file SVFType.h.

382 {
383 retTy = rt;
384 }

Friends And Related Symbol Documentation

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 371 of file SVFType.h.

Member Data Documentation

◆ params

std::vector<const SVFType*> SVF::SVFFunctionType::params
private

Definition at line 374 of file SVFType.h.

◆ retTy

const SVFType* SVF::SVFFunctionType::retTy
private

Definition at line 373 of file SVFType.h.

◆ varArg

bool SVF::SVFFunctionType::varArg
private

Definition at line 375 of file SVFType.h.


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