
This patch also takes the first step to remove backward compatibility code from the passes. We only support the in-tree LLVM version. Change-Id: I7836e524404afba151d1a8bfa539b505e1dbdb8e
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#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
|