-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFindStructElements.hh
More file actions
43 lines (32 loc) · 1.25 KB
/
FindStructElements.hh
File metadata and controls
43 lines (32 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef INCLUDE_FIND_STRUCT_ELEMENTS_HH
#define INCLUDE_FIND_STRUCT_ELEMENTS_HH
#include "FindSentinelHelper.hh"
#include "StructElement.hh"
#include <llvm/Pass.h>
#include <map>
#include <memory>
#include <vector>
typedef std::map<StructElement, std::shared_ptr<ValueSet>> StructElementToValueSet;
class FindStructElements : public llvm::ModulePass {
public:
// standard LLVM pass interface
FindStructElements();
static char ID;
void getAnalysisUsage(llvm::AnalysisUsage &) const final;
bool runOnModule(llvm::Module &) override final;
void print(llvm::raw_ostream &, const llvm::Module *) const override;
// access to analysis results derived by this pass
const StructElementToValueSet &getStructElements() const;
const std::vector<const llvm::StructType *> &getAllStructs() const;
private:
StructElementToValueSet structElementCollections;
std::vector<const llvm::StructType *> orderedTypes;
};
////////////////////////////////////////////////////////////////////////
inline const StructElementToValueSet &FindStructElements::getStructElements() const {
return structElementCollections;
}
inline const std::vector<const llvm::StructType*> &FindStructElements::getAllStructs() const {
return orderedTypes;
}
#endif // !INCLUDE_FIND_STRUCT_ELEMENTS_HH