ClearBlue
OCValueFlowBuilder.h
1 //
2 // Created by yongchao on 3/6/24.
3 //
4 
5 #ifndef CLEARBLUE_BUILDOCVALUEFLOW_H
6 #define CLEARBLUE_BUILDOCVALUEFLOW_H
7 
8 #include "Analysis/Bitcode/DebugInfoAnalysis.h"
9 #include "Analysis/Graph/ControlDependenceGraph.h"
10 #include "IR/SEG/SymbolicExprGraph.h"
11 #include <llvm/IR/BasicBlock.h>
12 #include <llvm/IR/CallSite.h>
13 #include <llvm/IR/Constants.h>
14 #include <llvm/IR/Function.h>
15 #include <llvm/IR/InstIterator.h>
16 #include <llvm/IR/Instructions.h>
17 #include <llvm/IR/Operator.h>
18 #include <llvm/IR/Value.h>
19 
20 using namespace llvm;
21 
22 class SymbolicExprGraph;
23 class SEGOperandNode;
24 
26 
27 private:
28  DebugInfoAnalysis *DIA = nullptr;
29  TSDataLayout *TSDL = nullptr;
30  ControlDependenceAnalysis *CDGs = nullptr;
31 
32 public:
33  OCValueFlowBuilder(DebugInfoAnalysis *DIA, TSDataLayout *TSDL,
34  ControlDependenceAnalysis *CDGs);
35 
37 
39  SymbolicExprGraph *buildSymbolicExprGraph(Function &F);
40 
42  void modelInstruction(Instruction &I, BasicBlock *B, SymbolicExprGraph *SEG);
43 
45  void modelIntrinsics(CallSite CS, SymbolicExprGraph *G);
46 
48  SEGOperandNode *modelConstantExpr(ConstantExpr *CE, SymbolicExprGraph *SEG);
49 
51  SEGOpcodeNode *modelGEPOperator(GEPOperator *GEP, BasicBlock *B,
53 
56  SEGOpcodeNode::CodeKind getOpcode(int LLVMInstOpcode, int Predicate = 0);
57 
59  SEGOperandNode *findOrCreateNode(SymbolicExprGraph *SEG, Value *V);
60 };
61 
62 #endif // CLEARBLUE_BUILDOCVALUEFLOW_H
SEGOperandNode
Definition: SymbolicExprGraph.h:456
SEGOpcodeNode::CodeKind
CodeKind
Definition: SymbolicExprGraph.h:522
SymbolicExprGraph
Definition: SymbolicExprGraph.h:708
OCValueFlowBuilder
Definition: OCValueFlowBuilder.h:25
SEGOpcodeNode
Definition: SymbolicExprGraph.h:519