ClearBlue
SEGMapBase.h
1 //
2 // Created by sixiang on 9/30/24.
3 //
4 
5 #ifndef CLEARBLUE_SEGMAPBASE_H
6 #define CLEARBLUE_SEGMAPBASE_H
7 
8 #include <llvm/IR/Function.h>
9 #include <llvm/IR/Module.h>
10 #include <llvm/Support/raw_ostream.h>
11 
12 #include <unordered_map>
13 
14 #include "Analysis/CallGraph/CBCallGraph.h"
15 #include "IR/SEG/SymbolicExprGraph.h"
16 #include "Language/Spec/Memory.h"
17 
18 using namespace llvm;
19 
20 class CBCallGraphWrapper;
21 
22 class SEGMapBase {
23 protected:
25  std::unordered_map<const Function *, SymbolicExprGraph *> SEGMap;
26 
27 public:
28  SEGMapBase();
29  ~SEGMapBase();
30 
31 public:
32  SymbolicExprGraph *getSymbolicExprGraph(const Function *F) const;
33 
34  bool hasSEG(const Function *F) const;
35 
37  bool isFuncBuildable(const Function *F) const;
38 
40  value_iterator<
41  std::unordered_map<const Function *, SymbolicExprGraph *>::iterator>
42  begin() {
43  return {SEGMap.begin()};
44  }
45 
47  value_iterator<
48  std::unordered_map<const Function *, SymbolicExprGraph *>::iterator>
49  end() {
50  return {SEGMap.end()};
51  }
52 
53 protected:
54  ExternalMemorySpec *MEM_SPEC = nullptr;
55  CBCallGraphWrapper *CGWrapper = nullptr;
56 };
57 
58 #endif // CLEARBLUE_SEGMAPBASE_H
SEGMapBase::begin
value_iterator< std::unordered_map< const Function *, SymbolicExprGraph * >::iterator > begin()
@iterating_object_class SymbolicExprGraph *
Definition: SEGMapBase.h:42
SEGMapBase
Definition: SEGMapBase.h:22
SymbolicExprGraph
Definition: SymbolicExprGraph.h:710
SEGMapBase::end
value_iterator< std::unordered_map< const Function *, SymbolicExprGraph * >::iterator > end()
@iterating_object_class SymbolicExprGraph *
Definition: SEGMapBase.h:49
SEGMapBase::SEGMap
std::unordered_map< const Function *, SymbolicExprGraph * > SEGMap
SEG vector of functions.
Definition: SEGMapBase.h:25