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

#include <SVFValue.h>

Inheritance diagram for SVF::SVFValue:
SVF::SVFArgument SVF::SVFBasicBlock SVF::SVFConstant SVF::SVFFunction SVF::SVFInstruction SVF::SVFOtherValue SVF::SVFConstantData SVF::SVFGlobalValue SVF::SVFCallInst SVF::SVFMetadataAsValue SVF::SVFBlackHoleValue SVF::SVFConstantFP SVF::SVFConstantInt SVF::SVFConstantNullPtr

Public Types

enum  SVFValKind {
  SVFVal , SVFFunc , SVFBB , SVFInst ,
  SVFCall , SVFVCall , SVFGlob , SVFArg ,
  SVFConst , SVFConstData , SVFConstInt , SVFConstFP ,
  SVFNullPtr , SVFBlackHole , SVFMetaAsValue , SVFOther
}
 
typedef s64_t GNodeK
 

Public Member Functions

 SVFValue ()=delete
 
virtual ~SVFValue ()=default
 
GNodeK getKind () const
 Get the type of this SVFValue.
 
const std::string & getName () const
 
void setName (const std::string &n)
 
void setName (std::string &&n)
 
virtual const SVFTypegetType () const
 
bool isConstDataOrAggData () const
 
bool ptrInUncalledFunction () const
 
bool isblackHole () const
 
bool isNullPtr () const
 
virtual void setSourceLoc (const std::string &sourceCodeInfo)
 
virtual const std::string getSourceLoc () const
 
std::string toString () const
 Needs to be implemented by a SVF front end.
 

Protected Member Functions

 SVFValue (const SVFType *ty, SVFValKind k)
 Constructor without name.
 
void setConstDataOrAggData ()
 
void setPtrInUncalledFunction ()
 

Protected Attributes

const SVFTypetype
 Type of this SVFValue.
 
std::string name
 Short name of value for printing & debugging.
 
std::string sourceLoc
 

Private Attributes

GNodeK kind
 used for classof
 
bool ptrInUncalledFun
 true if this pointer is in an uncalled function
 
bool constDataOrAggData
 true if this value is a ConstantData (e.g., numbers, string, floats) or a constantAggregate
 

Friends

class SVFIRWriter
 
class SVFIRReader
 
class LLVMModuleSet
 
OutStreamoperator<< (OutStream &os, const SVFValue &value)
 Overloading operator << for dumping ICFG node ID.
 

Detailed Description

Definition at line 177 of file SVFValue.h.

Member Typedef Documentation

◆ GNodeK

Definition at line 184 of file SVFValue.h.

Member Enumeration Documentation

◆ SVFValKind

Enumerator
SVFVal 
SVFFunc 
SVFBB 
SVFInst 
SVFCall 
SVFVCall 
SVFGlob 
SVFArg 
SVFConst 
SVFConstData 
SVFConstInt 
SVFConstFP 
SVFNullPtr 
SVFBlackHole 
SVFMetaAsValue 
SVFOther 

Definition at line 186 of file SVFValue.h.

Constructor & Destructor Documentation

◆ SVFValue() [1/2]

SVF::SVFValue::SVFValue ( const SVFType ty,
SVFValKind  k 
)
inlineprotected

Constructor without name.

Definition at line 216 of file SVFValue.h.

217 : kind(k), ptrInUncalledFun(false),
219 {
220 }
std::string sourceLoc
Definition SVFValue.h:214
bool ptrInUncalledFun
true if this pointer is in an uncalled function
Definition SVFValue.h:208
GNodeK kind
used for classof
Definition SVFValue.h:207
bool constDataOrAggData
true if this value is a ConstantData (e.g., numbers, string, floats) or a constantAggregate
Definition SVFValue.h:209
const SVFType * type
Type of this SVFValue.
Definition SVFValue.h:212
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ SVFValue() [2/2]

SVF::SVFValue::SVFValue ( )
delete

◆ ~SVFValue()

virtual SVF::SVFValue::~SVFValue ( )
virtualdefault

Member Function Documentation

◆ getKind()

GNodeK SVF::SVFValue::getKind ( ) const
inline

Get the type of this SVFValue.

Definition at line 238 of file SVFValue.h.

239 {
240 return kind;
241 }

◆ getName()

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

Definition at line 243 of file SVFValue.h.

244 {
245 return name;
246 }
std::string name
Short name of value for printing & debugging.
Definition SVFValue.h:213

◆ getSourceLoc()

virtual const std::string SVF::SVFValue::getSourceLoc ( ) const
inlinevirtual

Definition at line 280 of file SVFValue.h.

281 {
282 return sourceLoc;
283 }

◆ getType()

virtual const SVFType * SVF::SVFValue::getType ( ) const
inlinevirtual

Definition at line 256 of file SVFValue.h.

257 {
258 return type;
259 }

◆ isblackHole()

bool SVF::SVFValue::isblackHole ( ) const
inline

Definition at line 268 of file SVFValue.h.

269 {
270 return getKind() == SVFBlackHole;;
271 }
GNodeK getKind() const
Get the type of this SVFValue.
Definition SVFValue.h:238

◆ isConstDataOrAggData()

bool SVF::SVFValue::isConstDataOrAggData ( ) const
inline

Definition at line 260 of file SVFValue.h.

261 {
262 return constDataOrAggData;
263 }

◆ isNullPtr()

bool SVF::SVFValue::isNullPtr ( ) const
inline

Definition at line 272 of file SVFValue.h.

273 {
274 return getKind() == SVFNullPtr;
275 }

◆ ptrInUncalledFunction()

bool SVF::SVFValue::ptrInUncalledFunction ( ) const
inline

Definition at line 264 of file SVFValue.h.

265 {
266 return ptrInUncalledFun;
267 }

◆ setConstDataOrAggData()

void SVF::SVFValue::setConstDataOrAggData ( )
inlineprotected

attributes to be set only through Module builders e.g., LLVMModule

Definition at line 224 of file SVFValue.h.

225 {
226 constDataOrAggData = true;
227 }

◆ setName() [1/2]

void SVF::SVFValue::setName ( const std::string &  n)
inline

Definition at line 247 of file SVFValue.h.

248 {
249 name = n;
250 }
cJSON * n
Definition cJSON.cpp:2558

◆ setName() [2/2]

void SVF::SVFValue::setName ( std::string &&  n)
inline

Definition at line 251 of file SVFValue.h.

252 {
253 name = std::move(n);
254 }

◆ setPtrInUncalledFunction()

void SVF::SVFValue::setPtrInUncalledFunction ( )
inlineprotected

Definition at line 228 of file SVFValue.h.

229 {
230 ptrInUncalledFun = true;
231 }

◆ setSourceLoc()

virtual void SVF::SVFValue::setSourceLoc ( const std::string &  sourceCodeInfo)
inlinevirtual

Definition at line 276 of file SVFValue.h.

277 {
279 }

◆ toString()

std::string SVF::SVFValue::toString ( ) const

Needs to be implemented by a SVF front end.

Definition at line 721 of file LLVMUtil.cpp.

722{
723 std::string str;
724 llvm::raw_string_ostream rawstr(str);
725 if (const SVF::SVFFunction* fun = SVFUtil::dyn_cast<SVFFunction>(this))
726 {
727 rawstr << "Function: " << fun->getName() << " ";
728 }
729 else if (const SVFBasicBlock* bb = SVFUtil::dyn_cast<SVFBasicBlock>(this))
730 {
731 rawstr << "BasicBlock: " << bb->getName() << " ";
732 }
733 else
734 {
736 if (llvmVal)
737 rawstr << " " << *llvmVal << " ";
738 else
739 rawstr << " No llvmVal found";
740 }
741 rawstr << this->getSourceLoc();
742 return rawstr.str();
743}
static LLVMModuleSet * getLLVMModuleSet()
Definition LLVMModule.h:122
const Value * getLLVMValue(const SVFValue *value) const
Definition LLVMModule.h:239
virtual const std::string getSourceLoc() const
Definition SVFValue.h:280

Friends And Related Symbol Documentation

◆ LLVMModuleSet

Definition at line 181 of file SVFValue.h.

◆ operator<<

OutStream & operator<< ( OutStream os,
const SVFValue value 
)
friend

Overloading operator << for dumping ICFG node ID.

Definition at line 290 of file SVFValue.h.

291 {
292 return os << value.toString();
293 }

◆ SVFIRReader

Definition at line 180 of file SVFValue.h.

◆ SVFIRWriter

Definition at line 179 of file SVFValue.h.

Member Data Documentation

◆ constDataOrAggData

bool SVF::SVFValue::constDataOrAggData
private

true if this value is a ConstantData (e.g., numbers, string, floats) or a constantAggregate

Definition at line 209 of file SVFValue.h.

◆ kind

GNodeK SVF::SVFValue::kind
private

used for classof

Definition at line 207 of file SVFValue.h.

◆ name

std::string SVF::SVFValue::name
protected

Short name of value for printing & debugging.

Definition at line 213 of file SVFValue.h.

◆ ptrInUncalledFun

bool SVF::SVFValue::ptrInUncalledFun
private

true if this pointer is in an uncalled function

Definition at line 208 of file SVFValue.h.

◆ sourceLoc

std::string SVF::SVFValue::sourceLoc
protected

Source code information of this value

Definition at line 214 of file SVFValue.h.

◆ type

const SVFType* SVF::SVFValue::type
protected

Type of this SVFValue.

Definition at line 212 of file SVFValue.h.


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