ClearBlue
SEGCallSitePseudoInputNode.h
1 /*
2  * SEGCallSitePseudoInputNode.h
3  *
4  * Zhou Jinguo
5  *
6  * 2016.5.19
7  *
8  * This node is to model the pseudo input of a call site.
9  */
10 
11 #ifndef IR_SEG_SEGCALLSITEPSEUDOINPUTNODE_H
12 #define IR_SEG_SEGCALLSITEPSEUDOINPUTNODE_H
13 
14 #include <llvm/IR/BasicBlock.h>
15 #include <llvm/IR/CallSite.h>
16 #include <llvm/IR/Constants.h>
17 #include <llvm/IR/Function.h>
18 #include <llvm/IR/Instructions.h>
19 #include <llvm/IR/Value.h>
20 #include <llvm/Support/FileSystem.h>
21 #include <llvm/Support/Format.h>
22 #include <llvm/Support/raw_ostream.h>
23 
24 #include "CBAccessPath.h"
25 #include "IR/SEG/SymbolicExprGraph.h"
26 
27 using namespace llvm;
28 
30 protected:
31  CallSite LLVMCS;
32 
33  Function *Callee = nullptr;
34 
35  SEGCallSitePseudoInputNode(CallSite CS, Function *Callee, Value *Val,
36  Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB,
37  bool fromDisk)
38  : SEGOperandNode(SEGOBJK_CallSitePseudoInput, Val, Ty, SEG, BB, fromDisk),
39  LLVMCS(CS), Callee(Callee), index(-1) {
40  access_path.reset(Val);
41  }
42 
43  friend class SymbolicExprGraph;
44  friend class SEGCallSite;
45  friend class SEGSerializer;
46 
47  CBAccessPath access_path;
48 
49  int64_t index;
50 
51 public:
53 
54  CallSite getCallSite() const { return LLVMCS; }
55 
56  Function *getCallee() const { return Callee; }
57 
58  virtual int64_t getIndex() const { return index; }
59 
60  const CBAccessPath &getAccessPath() const { return access_path; }
61 
62  CBAccessPath &getAccessPath() { return access_path; }
63 
64 public:
65  static bool classof(const SEGObject *N) {
66  return N->getKind() == SEGOBJK_CallSitePseudoInput;
67  }
68 };
69 
70 #endif
SEGOperandNode
Definition: SymbolicExprGraph.h:456
SEGCallSite
Definition: SEGCallSite.h:51
SymbolicExprGraph
Definition: SymbolicExprGraph.h:708
SEGObject
Definition: SymbolicExprGraph.h:76
SEGCallSitePseudoInputNode
Definition: SEGCallSitePseudoInputNode.h:29
CBAccessPath
Definition: CBAccessPath.h:22