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