|
30 | 30 | #include "boost/container/flat_set.hpp" |
31 | 31 | #include "boost/graph/adjacency_list.hpp" |
32 | 32 |
|
| 33 | +#include "llvm/ADT/DenseSet.h" |
33 | 34 | #include "llvm/ADT/StringRef.h" |
34 | 35 | #include "llvm/IR/Constants.h" |
| 36 | +#include "llvm/IR/InstrTypes.h" |
35 | 37 | #include "llvm/IR/Instruction.h" |
36 | 38 | #include "llvm/IR/Module.h" |
37 | 39 |
|
@@ -71,35 +73,23 @@ class LLVMBasedICFG |
71 | 73 | LLVMTypeHierarchy *TH; |
72 | 74 | LLVMPointsToInfo *PT; |
73 | 75 | std::unique_ptr<Resolver> Res; |
74 | | - std::unordered_set<const llvm::Function *> VisitedFunctions; |
| 76 | + llvm::DenseSet<const llvm::Function *> VisitedFunctions; |
75 | 77 | llvm::SmallPtrSet<llvm::Function *, 2> UserEntryPoints; |
76 | 78 |
|
77 | 79 | GlobalCtorTy GlobalCtors; |
78 | 80 | GlobalDtorTy GlobalDtors; |
79 | 81 |
|
80 | | - // llvm::SmallDenseMap<F, typename GlobalCtorTy::const_iterator, 2> |
81 | | - // GlobalCtorFn; llvm::SmallDenseMap<F, typename GlobalDtorTy::const_iterator, |
82 | | - // 2> GlobalDtorFn; |
83 | | - |
84 | 82 | llvm::Function *GlobalCleanupFn = nullptr; |
85 | 83 |
|
86 | 84 | llvm::SmallDenseMap<const llvm::Module *, llvm::Function *> |
87 | 85 | GlobalRegisteredDtorsCaller; |
88 | | - /// Keeps track of the call-sites already resolved |
89 | | - // std::vector<const llvm::Instruction *> CallStack; |
90 | | - |
91 | | - // Keeps track of the type graph already constructed |
92 | | - // TypeGraph_t typegraph; |
93 | | - |
94 | | - // Any types that could be initialized outside of the module |
95 | | - // std::set<const llvm::StructType*> unsound_types; |
96 | 86 |
|
97 | 87 | // The worklist for direct callee resolution. |
98 | 88 | std::vector<const llvm::Function *> FunctionWL; |
99 | 89 |
|
100 | 90 | // Map indirect calls to the number of possible targets found for it. Fixpoint |
101 | 91 | // is not reached when more targets are found. |
102 | | - std::unordered_map<const llvm::Instruction *, unsigned> IndirectCalls; |
| 92 | + llvm::DenseMap<const llvm::Instruction *, unsigned> IndirectCalls; |
103 | 93 | // The VertexProperties for our call-graph. |
104 | 94 | struct VertexProperties { |
105 | 95 | const llvm::Function *F = nullptr; |
|
0 commit comments