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

#include <SVFStatements.h>

Inheritance diagram for SVF::BinaryOPStmt:
SVF::MultiOpndStmt SVF::SVFStmt SVF::GenericEdge< NodeTy >

Public Types

enum  OpCode : unsigned {
  Add = 13 , FAdd = 14 , Sub = 15 , FSub = 16 ,
  Mul = 17 , FMul = 18 , UDiv = 19 , SDiv = 20 ,
  FDiv = 21 , URem = 22 , SRem = 23 , FRem = 24 ,
  Shl = 25 , LShr = 26 , AShr = 27 , And = 28 ,
  Or = 29 , Xor = 30
}
 OpCode for BinaryOPStmt, enum value is same to llvm BinaryOperator (llvm/IR/Instruction.def) More...
 
- Public Types inherited from SVF::MultiOpndStmt
typedef std::vector< SVFVar * > OPVars
 
- Public Types inherited from SVF::SVFStmt
enum  PEDGEK {
  Addr , Copy , Store , Load ,
  Call , Ret , Gep , Phi ,
  Select , Cmp , BinaryOp , UnaryOp ,
  Branch , ThreadFork , ThreadJoin
}
 
typedef GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
 
typedef Map< EdgeID, SVFStmtSetTyPAGEdgeToSetMapTy
 
typedef PAGEdgeToSetMapTy KindToSVFStmtMapTy
 
typedef SVFStmtSetTy PAGEdgeSetTy
 
- Public Types inherited from SVF::GenericEdge< NodeTy >
typedef NodeTy NodeType
 Node type.
 
typedef u64_t GEdgeFlag
 
typedef s64_t GEdgeKind
 
typedef struct SVF::GenericEdge::equalGEdge equalGEdge
 Add the hash function for std::set (we also can overload operator< to implement this)
 

Public Member Functions

 BinaryOPStmt (SVFVar *res, const OPVars &opnds, u32_t oc)
 constructor
 
u32_t getOpcode () const
 
virtual const std::string toString () const override
 
- Public Member Functions inherited from SVF::MultiOpndStmt
const SVFVargetOpVar (u32_t pos) const
 Operand SVFVars.
 
const SVFVargetRes () const
 Result SVFVar.
 
NodeID getOpVarID (u32_t pos) const
 
NodeID getResID () const
 
u32_t getOpVarNum () const
 
const OPVarsgetOpndVars () const
 
OPVars::const_iterator opVarBegin () const
 
OPVars::const_iterator opVerEnd () const
 
- Public Member Functions inherited from SVF::SVFStmt
 SVFStmt (SVFVar *s, SVFVar *d, GEdgeFlag k, bool real=true)
 Constructor.
 
 ~SVFStmt ()
 Destructor.
 
EdgeID getEdgeID () const
 Return Edge ID.
 
virtual bool isPTAEdge () const
 Whether src and dst nodes are both of pointer type.
 
void setValue (const SVFVar *val)
 Get/set methods for llvm instruction.
 
const SVFVargetValue () const
 
void setBB (const SVFBasicBlock *bb)
 
const SVFBasicBlockgetBB () const
 
void setICFGNode (ICFGNode *node)
 
ICFGNodegetICFGNode () const
 
- Public Member Functions inherited from SVF::GenericEdge< NodeTy >
 GenericEdge (NodeTy *s, NodeTy *d, GEdgeFlag k)
 Constructor.
 
virtual ~GenericEdge ()
 Destructor.
 
NodeID getSrcID () const
 get methods of the components
 
NodeID getDstID () const
 
GEdgeKind getEdgeKind () const
 
GEdgeKind getEdgeKindWithoutMask () const
 
NodeTypegetSrcNode () const
 
NodeTypegetDstNode () const
 
virtual bool operator== (const GenericEdge< NodeType > *rhs) const
 

Static Public Member Functions

static bool classof (const BinaryOPStmt *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 
static bool classof (const SVFStmt *edge)
 
static bool classof (const MultiOpndStmt *edge)
 
static bool classof (const GenericPAGEdgeTy *edge)
 
- Static Public Member Functions inherited from SVF::MultiOpndStmt
static bool classof (const MultiOpndStmt *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 
static bool classof (const SVFStmt *node)
 
static bool classof (const GenericPAGEdgeTy *node)
 
- Static Public Member Functions inherited from SVF::SVFStmt
static bool classof (const SVFStmt *)
 ClassOf.
 
static bool classof (const GenericPAGEdgeTy *edge)
 
static GEdgeFlag makeEdgeFlagWithAddionalOpnd (GEdgeKind k, const SVFVar *var)
 
static GEdgeFlag makeEdgeFlagWithCallInst (GEdgeKind k, const ICFGNode *cs)
 
static GEdgeFlag makeEdgeFlagWithStoreInst (GEdgeKind k, const ICFGNode *store)
 
static const Inst2LabelMapgetInst2LabelMap ()
 
static const Var2LabelMapgetVar2LabelMap ()
 
static const u64_tgetCallEdgeLabelCounter ()
 
static const u64_tgetStoreEdgeLabelCounter ()
 
static const u64_tgetMultiOpndLabelCounter ()
 

Private Member Functions

 BinaryOPStmt (const BinaryOPStmt &)
 place holder
 
void operator= (const BinaryOPStmt &)
 place holder
 

Private Attributes

u32_t opcode
 

Friends

class GraphDBClient
 

Additional Inherited Members

- Protected Member Functions inherited from SVF::MultiOpndStmt
 MultiOpndStmt (SVFVar *r, const OPVars &opnds, GEdgeFlag k)
 Constructor, only used by subclasses but not external users.
 
- Protected Member Functions inherited from SVF::SVFStmt
 SVFStmt (GEdgeFlag k)
 Private constructor for reading SVFIR from file without side-effect.
 
 SVFStmt (SVFVar *s, SVFVar *d, GEdgeFlag k, EdgeID eid, SVFVar *value, ICFGNode *icfgNode, bool real=true)
 
void setBasicBlock (const SVFBasicBlock *bb)
 
void setCallEdgeLabelCounter (u64_t counter)
 
void setStoreEdgeLabelCounter (u64_t counter)
 
void setMultiOpndLabelCounter (u64_t counter)
 
- Static Protected Member Functions inherited from SVF::SVFStmt
static void addInst2Labeled (const ICFGNode *cs, u32_t label)
 
static void addVar2Labeled (const SVFVar *var, u32_t label)
 
- Protected Attributes inherited from SVF::MultiOpndStmt
OPVars opVars
 
- Static Protected Attributes inherited from SVF::GenericEdge< NodeTy >
static constexpr unsigned char EdgeKindMaskBits = 8
 We use the lower 8 bits to denote edge kind.
 
static constexpr u64_t EdgeKindMask = (~0ULL) >> (64 - EdgeKindMaskBits)
 

Detailed Description

Binary statement

Definition at line 1078 of file SVFStatements.h.

Member Enumeration Documentation

◆ OpCode

OpCode for BinaryOPStmt, enum value is same to llvm BinaryOperator (llvm/IR/Instruction.def)

Enumerator
Add 
FAdd 
Sub 
FSub 
Mul 
FMul 
UDiv 
SDiv 
FDiv 
URem 
SRem 
FRem 
Shl 
LShr 
AShr 
And 
Or 
Xor 

Definition at line 1088 of file SVFStatements.h.

1089 {
1090 Add = 13, // Sum of integers
1091 FAdd = 14, // Sum of floats
1092 Sub = 15, // Subtraction of integers
1093 FSub = 16, // Subtraction of floats
1094 Mul = 17, // Product of integers.
1095 FMul = 18, // Product of floats.
1096 UDiv = 19, // Unsigned division.
1097 SDiv = 20, // Signed division.
1098 FDiv = 21, // Float division.
1099 URem = 22, // Unsigned remainder
1100 SRem = 23, // Signed remainder
1101 FRem = 24, // Float remainder
1102 Shl = 25, // Shift left (logical)
1103 LShr = 26, // Shift right (logical)
1104 AShr = 27, // Shift right (arithmetic)
1105 And = 28, // Logical and
1106 Or = 29, // Logical or
1107 Xor = 30 // Logical xor
1108 };

Constructor & Destructor Documentation

◆ BinaryOPStmt() [1/2]

SVF::BinaryOPStmt::BinaryOPStmt ( const BinaryOPStmt )
private

place holder

◆ BinaryOPStmt() [2/2]

BinaryOPStmt::BinaryOPStmt ( SVFVar res,
const OPVars opnds,
u32_t  oc 
)

constructor

Definition at line 378 of file SVFStatements.cpp.

380 s, opnds,
382 opcode(oc)
383{
384 assert(opnds.size() == 2 && "BinaryOPStmt can only have two operands!");
385}
MultiOpndStmt()
place holder
static GEdgeFlag makeEdgeFlagWithAddionalOpnd(GEdgeKind k, const SVFVar *var)
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ classof() [1/4]

static bool SVF::BinaryOPStmt::classof ( const BinaryOPStmt )
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 1112 of file SVFStatements.h.

1113 {
1114 return true;
1115 }

◆ classof() [2/4]

static bool SVF::BinaryOPStmt::classof ( const GenericPAGEdgeTy edge)
inlinestatic

Definition at line 1124 of file SVFStatements.h.

1125 {
1126 return edge->getEdgeKind() == SVFStmt::BinaryOp;
1127 }

◆ classof() [3/4]

static bool SVF::BinaryOPStmt::classof ( const MultiOpndStmt edge)
inlinestatic

Definition at line 1120 of file SVFStatements.h.

1121 {
1122 return edge->getEdgeKind() == SVFStmt::BinaryOp;
1123 }

◆ classof() [4/4]

static bool SVF::BinaryOPStmt::classof ( const SVFStmt edge)
inlinestatic

Definition at line 1116 of file SVFStatements.h.

1117 {
1118 return edge->getEdgeKind() == SVFStmt::BinaryOp;
1119 }

◆ getOpcode()

u32_t SVF::BinaryOPStmt::getOpcode ( ) const
inline

Definition at line 1133 of file SVFStatements.h.

1134 {
1135 return opcode;
1136 }

◆ operator=()

void SVF::BinaryOPStmt::operator= ( const BinaryOPStmt )
private

place holder

◆ toString()

const std::string BinaryOPStmt::toString ( ) const
overridevirtual

Reimplemented from SVF::SVFStmt.

Definition at line 155 of file SVFStatements.cpp.

156{
157 std::string str;
158 std::stringstream rawstr(str);
159 rawstr << "BinaryOPStmt: [Var" << getResID() << " <-- (Var" << getOpVarID(0) << " opcode" << getOpcode() << " Var" << getOpVarID(1) << ")]\t";
161 {
162 rawstr << "\n";
163 rawstr << getValue()->toString();
164 }
165 return rawstr.str();
166}
u32_t getOpcode() const
NodeID getOpVarID(u32_t pos) const
NodeID getResID() const
static const Option< bool > ShowSVFIRValue
Definition Options.h:119
const SVFVar * getValue() const
virtual const std::string toString() const
Get string representation.

Friends And Related Symbol Documentation

◆ GraphDBClient

friend class GraphDBClient
friend

Definition at line 1080 of file SVFStatements.h.

Member Data Documentation

◆ opcode

u32_t SVF::BinaryOPStmt::opcode
private

Definition at line 1084 of file SVFStatements.h.


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