ClearBlue
SEGCallSiteReturnSummaryNode.h
1 /*
2  * SEGCallSiteReturnSummaryNode.h
3  *
4  * This node is to model a summary node passed from callee to caller.
5  *
6  * Created on: 2016.12.15
7  * Author: andyzhou
8  */
9 
10 #ifndef IR_SEG_SEGCALLSITERETURNSUMMARYNODE_H
11 #define IR_SEG_SEGCALLSITERETURNSUMMARYNODE_H
12 
13 #include "IR/SEG/SEGCallSite.h"
14 #include "IR/SEG/SymbolicExprGraph.h"
15 
16 using namespace llvm;
17 
19 class PersistedSEGCallSiteReturnSummaryNode;
20 
22 public:
25  SEGCallSiteReturnSummaryNode(PersistedSEGCallSiteReturnSummaryNode *Node,
26  SymbolicExprGraph *SEG);
27 
28  virtual void assembleSEGObject(std::map<int, SEGObject *> &FuncSEGObjMap);
29 
30 private:
31  // The callsite that the summary node is created for
32  Instruction *Callsite = nullptr;
33  WrappedInstruction *WrappedCallSite = nullptr;
34 
35  // 0-1 confidence of that the node is valid
36  float Confidence;
37 
38  SEGCallSiteReturnSummaryNode(Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB,
39  Instruction *Callsite, float Confidence);
40 
41 public:
43 
44  virtual PersistedSEGObject *createPersistedObject() const;
45 
46 public:
47  static bool classof(const SEGObject *N) {
48  return N->getKind() == SEGOBJK_CallSiteSummaryReturn;
49  }
50 
51  Instruction *getCallSiteInst() const { return Callsite; }
52 
53  WrappedInstruction *getWrappedCallSiteInst() const { return WrappedCallSite; }
54 
55  float getConfidence() const { return Confidence; }
56 
57  SEGCallSite *getSEGCallSite() const {
58  SEGSiteBase *SEGSite =
59  getParentGraph()->findSite<SEGSiteBase>(getCallSiteInst());
60  return dyn_cast<SEGCallSite>(SEGSite);
61  }
62 
63  friend class SymbolicExprGraph;
64 };
65 
66 #endif /* IR_SEG_SEGCALLSITERETURNSUMMARYNODE_H */
SEGOperandNode
Definition: SymbolicExprGraph.h:539
SEGCallSite
Definition: SEGCallSite.h:53
SymbolicExprGraph
Definition: SymbolicExprGraph.h:855
SEGCallSiteReturnSummaryNode
Definition: SEGCallSiteReturnSummaryNode.h:21
SEGObject
Definition: SymbolicExprGraph.h:87
SEGSiteBase
Definition: SymbolicExprGraph.h:776