diff options
author | Devang Patel <dpatel@apple.com> | 2006-10-23 23:12:26 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-10-23 23:12:26 +0000 |
commit | f2ca21f88f4e38996b6804dfa25fe7a72814736d (patch) | |
tree | 2cb458be78aea3eb7dfac72fd6fa9f2059c6b8fa | |
parent | a4bcfe12d1ea16e3e4ea9148e2d9cba3bb63dbda (diff) | |
download | external_llvm-f2ca21f88f4e38996b6804dfa25fe7a72814736d.zip external_llvm-f2ca21f88f4e38996b6804dfa25fe7a72814736d.tar.gz external_llvm-f2ca21f88f4e38996b6804dfa25fe7a72814736d.tar.bz2 |
Add removeModule().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31142 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/LinkTimeOptimizer.h | 2 | ||||
-rw-r--r-- | tools/lto/lto.cpp | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/LinkTimeOptimizer.h b/include/llvm/LinkTimeOptimizer.h index 654623a..6c58706 100644 --- a/include/llvm/LinkTimeOptimizer.h +++ b/include/llvm/LinkTimeOptimizer.h @@ -91,6 +91,7 @@ namespace llvm { std::vector<const char*> &, std::string &) = 0; virtual void getTargetTriple(const std::string &, std::string &) = 0; + virtual void removeModule (const std::string &InputFilename) = 0; virtual ~LinkTimeOptimizer() = 0; }; @@ -111,6 +112,7 @@ namespace llvm { std::vector<const char*> &exportList, std::string &targetTriple); void getTargetTriple(const std::string &InputFilename, std::string &targetTriple); + void removeModule (const std::string &InputFilename); private: Module *getModule (const std::string &InputFilename); diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index c4face2..b9d76d6 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -102,6 +102,18 @@ findExternalRefs(Value *value, std::set<std::string> &references, findExternalRefs(c->getOperand(i), references, mangler); } +/// If Moduel with InputFilename is available then remove it. +void +LTO::removeModule (const std::string &InputFilename) +{ + NameToModuleMap::iterator pos = allModules.find(InputFilename.c_str()); + if (pos != allModules.end()) { + Module *m = allModules[InputFilename.c_str()]; + allModules.erase(pos); + delete m; + } +} + /// InputFilename is a LLVM bytecode file. If Module with InputFilename is /// available then return it. Otherwise parseInputFilename. Module * |