llvm.org GIT mirror llvm / f2ca21f
Add removeModule(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31142 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 12 years ago
2 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9090 std::vector &,
9191 std::string &) = 0;
9292 virtual void getTargetTriple(const std::string &, std::string &) = 0;
93 virtual void removeModule (const std::string &InputFilename) = 0;
9394 virtual ~LinkTimeOptimizer() = 0;
9495 };
9596
110111 std::vector &exportList,
111112 std::string &targetTriple);
112113 void getTargetTriple(const std::string &InputFilename, std::string &targetTriple);
114 void removeModule (const std::string &InputFilename);
113115
114116 private:
115117 Module *getModule (const std::string &InputFilename);
101101 findExternalRefs(c->getOperand(i), references, mangler);
102102 }
103103
104 /// If Moduel with InputFilename is available then remove it.
105 void
106 LTO::removeModule (const std::string &InputFilename)
107 {
108 NameToModuleMap::iterator pos = allModules.find(InputFilename.c_str());
109 if (pos != allModules.end()) {
110 Module *m = allModules[InputFilename.c_str()];
111 allModules.erase(pos);
112 delete m;
113 }
114 }
115
104116 /// InputFilename is a LLVM bytecode file. If Module with InputFilename is
105117 /// available then return it. Otherwise parseInputFilename.
106118 Module *