Static Value-Flow Analysis
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
SVF::SVFLLVMValue Class Reference

#include <SVFLLVMValue.h>

Inheritance diagram for SVF::SVFLLVMValue:
SVF::SVFFunction

Public Types

enum  SVFValKind { SVFVal , SVFFunc }
 
typedef s64_t GNodeK
 

Public Member Functions

 SVFLLVMValue ()=delete
 
virtual ~SVFLLVMValue ()=default
 
GNodeK getKind () const
 Get the type of this SVFValue.
 
const std::string & getName () const
 
void setName (std::string &&n)
 
virtual const SVFTypegetType () const
 
bool isConstDataOrAggData () const
 
bool ptrInUncalledFunction () 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

 SVFLLVMValue (const SVFType *ty, SVFValKind k=SVFVal)
 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 SVFLLVMValue &value)
 Overloading operator << for dumping ICFG node ID.
 

Detailed Description

Definition at line 53 of file SVFLLVMValue.h.

Member Typedef Documentation

◆ GNodeK

Definition at line 60 of file SVFLLVMValue.h.

Member Enumeration Documentation

◆ SVFValKind

Enumerator
SVFVal 
SVFFunc 

Definition at line 62 of file SVFLLVMValue.h.

Constructor & Destructor Documentation

◆ SVFLLVMValue() [1/2]

SVF::SVFLLVMValue::SVFLLVMValue ( const SVFType ty,
SVFValKind  k = SVFVal 
)
inlineprotected

Constructor without name.

Definition at line 78 of file SVFLLVMValue.h.

79 : kind(k), ptrInUncalledFun(false),
80 constDataOrAggData(false), type(ty), sourceLoc("NoLoc")
81 {
82 }
GNodeK kind
used for classof
std::string sourceLoc
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
const SVFType * type
Type of this SVFValue.
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ SVFLLVMValue() [2/2]

SVF::SVFLLVMValue::SVFLLVMValue ( )
delete

◆ ~SVFLLVMValue()

virtual SVF::SVFLLVMValue::~SVFLLVMValue ( )
virtualdefault

Member Function Documentation

◆ getKind()

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

Get the type of this SVFValue.

Definition at line 100 of file SVFLLVMValue.h.

101 {
102 return kind;
103 }

◆ getName()

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

Definition at line 105 of file SVFLLVMValue.h.

106 {
107 return name;
108 }
std::string name
Short name of value for printing & debugging.

◆ getSourceLoc()

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

Definition at line 131 of file SVFLLVMValue.h.

132 {
133 return sourceLoc;
134 }

◆ getType()

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

Definition at line 115 of file SVFLLVMValue.h.

116 {
117 return type;
118 }

◆ isConstDataOrAggData()

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

Definition at line 119 of file SVFLLVMValue.h.

120 {
121 return constDataOrAggData;
122 }

◆ ptrInUncalledFunction()

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

Definition at line 123 of file SVFLLVMValue.h.

124 {
125 return ptrInUncalledFun;
126 }

◆ setConstDataOrAggData()

void SVF::SVFLLVMValue::setConstDataOrAggData ( )
inlineprotected

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

Definition at line 86 of file SVFLLVMValue.h.

87 {
88 constDataOrAggData = true;
89 }

◆ setName()

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

Definition at line 110 of file SVFLLVMValue.h.

111 {
112 name = std::move(n);
113 }
cJSON * n
Definition cJSON.cpp:2558

◆ setPtrInUncalledFunction()

void SVF::SVFLLVMValue::setPtrInUncalledFunction ( )
inlineprotected

Definition at line 90 of file SVFLLVMValue.h.

91 {
92 ptrInUncalledFun = true;
93 }

◆ setSourceLoc()

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

Definition at line 127 of file SVFLLVMValue.h.

128 {
130 }

◆ toString()

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

Needs to be implemented by a SVF front end.

Definition at line 746 of file LLVMUtil.cpp.

747{
748 std::string str;
749 llvm::raw_string_ostream rawstr(str);
750 if (const SVF::SVFFunction* fun = SVFUtil::dyn_cast<SVFFunction>(this))
751 {
752 rawstr << "Function: " << fun->getName() << " ";
753 }
754 else
755 {
757 if (llvmVal)
758 rawstr << " " << *llvmVal << " ";
759 else
760 rawstr << " No llvmVal found";
761 }
762 rawstr << this->getSourceLoc();
763 return rawstr.str();
764}
static LLVMModuleSet * getLLVMModuleSet()
Definition LLVMModule.h:137
const Value * getLLVMValue(const SVFLLVMValue *value) const
Definition LLVMModule.h:290
virtual const std::string getSourceLoc() const

Friends And Related Symbol Documentation

◆ LLVMModuleSet

Definition at line 57 of file SVFLLVMValue.h.

◆ operator<<

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

Overloading operator << for dumping ICFG node ID.

Definition at line 141 of file SVFLLVMValue.h.

142 {
143 return os << value.toString();
144 }

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 56 of file SVFLLVMValue.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 55 of file SVFLLVMValue.h.

Member Data Documentation

◆ constDataOrAggData

bool SVF::SVFLLVMValue::constDataOrAggData
private

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

Definition at line 71 of file SVFLLVMValue.h.

◆ kind

GNodeK SVF::SVFLLVMValue::kind
private

used for classof

Definition at line 69 of file SVFLLVMValue.h.

◆ name

std::string SVF::SVFLLVMValue::name
protected

Short name of value for printing & debugging.

Definition at line 75 of file SVFLLVMValue.h.

◆ ptrInUncalledFun

bool SVF::SVFLLVMValue::ptrInUncalledFun
private

true if this pointer is in an uncalled function

Definition at line 70 of file SVFLLVMValue.h.

◆ sourceLoc

std::string SVF::SVFLLVMValue::sourceLoc
protected

Source code information of this value

Definition at line 76 of file SVFLLVMValue.h.

◆ type

const SVFType* SVF::SVFLLVMValue::type
protected

Type of this SVFValue.

Definition at line 74 of file SVFLLVMValue.h.


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