Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | 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 *s, 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.
 
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)
 

Private Member Functions

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

Private Attributes

u32_t opcode
 

Additional Inherited Members

- Static Public Attributes inherited from SVF::SVFStmt
static u32_t totalEdgeNum
 Total edge number.
 
- 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.
 
- 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 968 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 978 of file SVFStatements.h.

979 {
980 Add = 13, // Sum of integers
981 FAdd = 14, // Sum of floats
982 Sub = 15, // Subtraction of integers
983 FSub = 16, // Subtraction of floats
984 Mul = 17, // Product of integers.
985 FMul = 18, // Product of floats.
986 UDiv = 19, // Unsigned division.
987 SDiv = 20, // Signed division.
988 FDiv = 21, // Float division.
989 URem = 22, // Unsigned remainder
990 SRem = 23, // Signed remainder
991 FRem = 24, // Float remainder
992 Shl = 25, // Shift left (logical)
993 LShr = 26, // Shift right (logical)
994 AShr = 27, // Shift right (arithmetic)
995 And = 28, // Logical and
996 Or = 29, // Logical or
997 Xor = 30 // Logical xor
998 };

Constructor & Destructor Documentation

◆ BinaryOPStmt() [1/2]

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

place holder

◆ BinaryOPStmt() [2/2]

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

constructor

Definition at line 366 of file SVFStatements.cpp.

368 s, opnds,
370 opcode(oc)
371{
372 assert(opnds.size() == 2 && "BinaryOPStmt can only have two operands!");
373}
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 1002 of file SVFStatements.h.

1003 {
1004 return true;
1005 }

◆ classof() [2/4]

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

Definition at line 1014 of file SVFStatements.h.

1015 {
1016 return edge->getEdgeKind() == SVFStmt::BinaryOp;
1017 }

◆ classof() [3/4]

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

Definition at line 1010 of file SVFStatements.h.

1011 {
1012 return edge->getEdgeKind() == SVFStmt::BinaryOp;
1013 }

◆ classof() [4/4]

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

Definition at line 1006 of file SVFStatements.h.

1007 {
1008 return edge->getEdgeKind() == SVFStmt::BinaryOp;
1009 }

◆ getOpcode()

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

Definition at line 1023 of file SVFStatements.h.

1024 {
1025 return opcode;
1026 }

◆ 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 145 of file SVFStatements.cpp.

146{
147 std::string str;
148 std::stringstream rawstr(str);
149 rawstr << "BinaryOPStmt: [Var" << getResID() << " <-- (Var" << getOpVarID(0) << " opcode" << getOpcode() << " Var" << getOpVarID(1) << ")]\t";
151 {
152 rawstr << "\n";
153 rawstr << getValue()->toString();
154 }
155 return rawstr.str();
156}
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.

Member Data Documentation

◆ opcode

u32_t SVF::BinaryOPStmt::opcode
private

Definition at line 974 of file SVFStatements.h.


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