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
|
#ifndef SECTIONIFY_PASS_H
#define SECTIONIFY_PASS_H
#include <pass.h>
using namespace llvm;
namespace llvm {
class SectionifyPass : public ModulePass {
public:
static char ID;
SectionifyPass();
virtual bool runOnModule(Module &M);
private:
std::map<Regex*, std::string> functionRegexMap;
std::vector<Regex*> functionRegexList;
std::map<Regex*, std::string> dataRegexMap;
std::vector<Regex*> dataRegexList;
std::string moduleName;
bool sectionifyFromRegex(GlobalObject *value, Regex *regex, std::string §ion);
bool sectionify(GlobalObject *value, std::vector<Regex*> ®exList, std::map<Regex*, std::string> ®exMap);
void parseAndInitRegexMap(cl::list<std::string> &stringListOpt, std::vector<Regex*> ®exList, std::map<Regex*, std::string> ®exMap, std::string regexType);
bool initRegexMap(std::map<Regex*, std::string> ®exMap, std::vector<Regex*> ®exList, std::map<std::string, std::string> &stringMap, std::vector<std::string> &stringList, std::string regexType);
bool parseStringMapOpt(std::map<std::string, std::string> &map, std::vector<std::string> &keyList, std::vector<std::string> &stringList);
};
}
#endif
|