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 SEGMapBase {
21 protected:
23  std::unordered_map<const Function *, SymbolicExprGraph *> SEGMap;
24 
25 public:
26  SEGMapBase();
27  ~SEGMapBase();
28 
29 public:
30  SymbolicExprGraph *getSymbolicExprGraph(const Function *F) const;
31 
32  bool hasSEG(const Function *F) const;
33 
35  bool isFuncBuildable(const Function *F) const;
36 
38  value_iterator<
39  std::unordered_map<const Function *, SymbolicExprGraph *>::iterator>
40  begin() {
41  return {SEGMap.begin()};
42  }
43 
45  value_iterator<
46  std::unordered_map<const Function *, SymbolicExprGraph *>::iterator>
47  end() {
48  return {SEGMap.end()};
49  }
50 
51 protected:
52  ExternalMemorySpec *MEM_SPEC = nullptr;
53 };
54 
55 #endif // CLEARBLUE_SEGMAPBASE_H
SEGMapBase::begin
value_iterator< std::unordered_map< const Function *, SymbolicExprGraph * >::iterator > begin()
@iterating_object_class SymbolicExprGraph *
Definition: SEGMapBase.h:40
SEGMapBase
Definition: SEGMapBase.h:20
SymbolicExprGraph
Definition: SymbolicExprGraph.h:708
SEGMapBase::end
value_iterator< std::unordered_map< const Function *, SymbolicExprGraph * >::iterator > end()
@iterating_object_class SymbolicExprGraph *
Definition: SEGMapBase.h:47
SEGMapBase::SEGMap
std::unordered_map< const Function *, SymbolicExprGraph * > SEGMap
SEG vector of functions.
Definition: SEGMapBase.h:23