ClearBlue
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
SEGOpcodeNode Class Referenceabstract

#include <SymbolicExprGraph.h>

Inheritance diagram for SEGOpcodeNode:
Inheritance graph
[legend]
Collaboration diagram for SEGOpcodeNode:
Collaboration graph
[legend]

Public Types

enum  CodeKind {
  CK_BinaryBegin, CK_URem = CK_BinaryBegin, CK_FRem, CK_SRem,
  CK_UDiv, CK_FDiv, CK_SDiv, CK_And,
  CK_Or, CK_Xor, CK_Add, CK_FAdd,
  CK_Sub, CK_FSub, CK_Mul, CK_FMul,
  CK_Shl, CK_LShr, CK_AShr, CK_BinaryEnd = CK_AShr,
  CK_CastBegin, CK_AddressCast = CK_CastBegin, CK_Int2Ptr, CK_Ptr2Int,
  CK_Bitcast, CK_Trunc, CK_FPTrunc, CK_SExt,
  CK_ZExt, CK_FPExt, CK_SI2FP, CK_FP2SI,
  CK_UI2FP, CK_FP2UI, CK_CastEnd = CK_FP2UI, CK_ExtractElmt,
  CK_InsertElmt, CK_Select, CK_GetElmtPtr, CK_Concat,
  CK_CmpBegin, CK_FFalse = CK_CmpBegin, CK_FOEq, CK_FOGT,
  CK_FOGE, CK_FOLT, CK_FOLE, CK_FONE,
  CK_FOrd, CK_FUno, CK_FUEq, CK_FUGT,
  CK_FUGE, CK_FULT, CK_FULE, CK_FUNE,
  CK_FTrue, CK_IEq, CK_INE, CK_IUGT,
  CK_IUGE, CK_IULT, CK_IULE, CK_ISGT,
  CK_ISGE, CK_ISLT, CK_ISLE, CK_CmpEnd = CK_ISLE,
  CK_InvalidCode
}
 
- Public Types inherited from SEGObject
enum  SEGObjectKind {
  SEGOBJK_NodeBegin, SEGOBJK_OperandBegin, SEGOBJK_ArgumentBegin, SEGOBJK_CommonArgument,
  SEGOBJK_VarArgument, SEGOBJK_PseudoArgument, SEGOBJK_ArgumentEnd, SEGOBJK_CallSiteOutputBegin,
  SEGOBJK_CallSiteCommonOutput, SEGOBJK_CallSitePseudoOutput, SEGOBJK_CallSiteOutputEnd, SEGOBJK_ReturnBegin,
  SEGOBJK_CommonReturn, SEGOBJK_PseudoReturn, SEGOBJK_ReturnEnd, SEGOBJK_LoadMem,
  SEGOBJK_StoreMem, SEGOBJK_Phi, SEGOBJK_Region, SEGOBJK_SimpleOperand,
  SEGOBJK_Undef, SEGOBJK_CallSitePseudoInput, SEGOBJK_CallSiteSummaryArgument, SEGOBJK_CallSiteSummaryReturn,
  SEGOBJK_OperandEnd, SEGOBJK_OpcodeBegin, SEGOBJK_BinaryWithIntConst, SEGOBJK_Cast,
  SEGOBJK_SimpleOpcode, SEGOBJK_OpcodeEnd, SEGOBJK_NodeEnd, SEGOBJK_SiteBegin,
  SEGOBJK_CallSite, SEGOBJK_ReturnSite, SEGOBJK_SimpleSiteBegin, SEGOBJK_GEPSite,
  SEGOBJK_DereferenceSite, SEGOBJK_DivSite, SEGOBJK_CmpSite, SEGOBJK_AllocSite,
  SEGOBJK_SimpleSiteEnd, SEGOBJK_SiteEnd
}
 

Public Member Functions

 SEGOpcodeNode (PersistedSEGOpcodeNode *Node, SymbolicExprGraph *SEG)
 
virtual void assembleSEGObject (std::map< int, SEGObject * > &FuncSEGObjMap)
 Assemble the SEG object's related objects. More...
 
CodeKind getOpcode () const
 
virtual void dot (raw_fd_ostream &O) const
 Dot its self to the given output stream.
 
bool isCmpNode () const
 
bool isSignedCmp () const
 
bool isUnSignedCmp () const
 
bool isFloatCmp () const
 
bool isAddNode () const
 
bool isSubNode () const
 
bool isGEPNode () const
 
bool isSelectNode () const
 
bool isCastNode () const
 
bool isBinaryNode () const
 
bool isExtractElmtNode () const
 
bool isInsertElmtNode () const
 
bool isConcatNode () const
 
- Public Member Functions inherited from SEGNodeBase
 SEGNodeBase (PersistedSEGNodeBase *Node, SymbolicExprGraph *SEG)
 
Type * getLLVMType () const
 get the type size of the node
 
uint64_t getTypeSize () const
 get the type size of the node
 
bool isVectorTy () const
 check whether LLVMType is vector type
 
bool isPointerTy () const
 
bool isSized () const
 
bool isStructTy () const
 
SEGType * getSEGType () const
 
unsigned getVectorNumElements () const
 check the number of elements in LLVMType
 
SEGNodeBasegetChild (unsigned I) const
 
float getConfidence (const SEGNodeBase *ParentNode) const
 
unsigned getNumChildren () const
 
unsigned getNumParents () const
 
void addChild (SEGNodeBase *N, float Confidence=1.0f)
 
void eraseAllChildren ()
 
void addUseSite (SEGSiteBase *U)
 
virtual bool isTerminalNode () const
 
SEGRegionNodegetRegion () const
 
bool containsParentNode (const SEGNodeBase *N) const
 
const std::string & getDescription () const
 
ValueFlowIterator vflow_begin () const
 
ValueFlowIterator vflow_end () const
 
key_iterator< std::map< const SEGNodeBase *, float >::const_iterator > parent_begin () const
 
key_iterator< std::map< const SEGNodeBase *, float >::const_iterator > parent_end () const
 
iterator_range< std::map< const SEGNodeBase *, float >::const_iterator > parents () const
 
std::vector< SEGNodeBase * >::const_iterator child_begin () const
 
std::vector< SEGNodeBase * >::const_iterator child_end () const
 
iterator_range< std::vector< SEGNodeBase * >::const_iterator > children () const
 
std::map< const SEGNodeBase *, float >::const_iterator parent_confidence_begin () const
 
std::map< const SEGNodeBase *, float >::const_iterator parent_confidence_end () const
 
size_t child_size () const
 
size_t parent_size () const
 
std::vector< SEGSiteBase * >::const_iterator use_site_begin () const
 
std::vector< SEGSiteBase * >::const_iterator use_site_end () const
 
iterator_range< std::vector< SEGSiteBase * >::const_iterator > use_sites ()
 
size_t use_site_size () const
 
- Public Member Functions inherited from SEGObject
 SEGObject (SEGObjectKind OK, SymbolicExprGraph *SEG, BasicBlock *BB)
 
 SEGObject (PersistedSEGObject *Obj, SymbolicExprGraph *SEG)
 
virtual Value * getLLVMDbgValue () const
 
virtual WrappedValue * getWrappedLLVMDbgValue () const
 
virtual Instruction * getLLVMDbgInstruction () const
 
virtual WrappedInstruction * getWrappedLLVMDbgInstruction () const
 
SEGObjectKind getKind () const
 
int getSEGIndex () const
 
int getObjIndex () const
 
const char * getKindName () const
 
BasicBlock * getParentBasicBlock () const
 
WrappedBasicBlock * getWrappedParentBasicBlock () const
 
Function * getParentFunction () const
 
const SymbolicExprGraphgetParentGraph () const
 
SymbolicExprGraphgetParentGraph ()
 
virtual PersistedSEGObject * createPersistedObject () const =0
 
virtual void persistSEGData (PersistedSymbolicExprGraph *PersistedSEG)
 
bool isFromLibrary () const
 
virtual std::string getSrcFile () const
 
virtual std::int32_t getSrcLine () const
 
virtual std::string getAuxiliaryDebugStr () const
 

Static Public Member Functions

static bool classof (const SEGObject *N)
 
static const char * getOpcodeName (CodeKind CK)
 
- Static Public Member Functions inherited from SEGNodeBase
static bool classof (const SEGObject *N)
 

Protected Member Functions

 SEGOpcodeNode (SEGObjectKind K, CodeKind Opcode, Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB)
 This constructor will set the field Inst as nullptr.
 
- Protected Member Functions inherited from SEGNodeBase
 SEGNodeBase (SEGObjectKind K, Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB)
 
void setDescription (std::string &Desc)
 

Protected Attributes

CodeKind Opcode
 
- Protected Attributes inherited from SEGObject
PersistedSEGObject * PersistedObj = nullptr
 the persistence object
 

Friends

class SymbolicExprGraph
 The class only can be initialized in the seg graph.
 

Detailed Description

The opcode node. Each node indicates the operation by its opcode.

Member Enumeration Documentation

◆ CodeKind

Enumerator
CK_FFalse 

0 0 0 0 Always false (always folded)

CK_FOEq 

0 0 0 1 True if ordered and equal

CK_FOGT 

0 0 1 0 True if ordered and greater than

CK_FOGE 

0 0 1 1 True if ordered and greater than or equal

CK_FOLT 

0 1 0 0 True if ordered and less than

CK_FOLE 

0 1 0 1 True if ordered and less than or equal

CK_FONE 

0 1 1 0 True if ordered and operands are unequal

CK_FOrd 

0 1 1 1 True if ordered (no nans)

CK_FUno 

1 0 0 0 True if unordered: isnan(X) | isnan(Y)

CK_FUEq 

1 0 0 1 True if unordered or equal

CK_FUGT 

1 0 1 0 True if unordered or greater than

CK_FUGE 

1 0 1 1 True if unordered, greater than, or equal

CK_FULT 

1 1 0 0 True if unordered or less than

CK_FULE 

1 1 0 1 True if unordered, less than, or equal

CK_FUNE 

1 1 1 0 True if unordered or not equal

CK_FTrue 

1 1 1 1 Always true (always folded)

CK_IEq 

equal

CK_INE 

not equal

CK_IUGT 

unsigned greater than

CK_IUGE 

unsigned greater or equal

CK_IULT 

unsigned less than

CK_IULE 

unsigned less or equal

CK_ISGT 

signed greater than

CK_ISGE 

signed greater or equal

CK_ISLT 

signed less than

CK_ISLE 

signed less or equal

Constructor & Destructor Documentation

◆ SEGOpcodeNode()

SEGOpcodeNode::SEGOpcodeNode ( PersistedSEGOpcodeNode *  Node,
SymbolicExprGraph SEG 
)

A constructor specially designed for persistence Use the persistence obj to initialize SEGOpcodeNode

Member Function Documentation

◆ assembleSEGObject()

virtual void SEGOpcodeNode::assembleSEGObject ( std::map< int, SEGObject * > &  FuncSEGObjMap)
inlinevirtual

Assemble the SEG object's related objects.

initialize the children and parents

initialize the use sites

initialize the region

Reimplemented from SEGNodeBase.

Reimplemented in SEGBinaryWithIntConstNode, SEGCastNode, and SEGSimpleOpcodeNode.

Here is the call graph for this function:

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