summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/lto/lto.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index c4face2712..b9d76d6738 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 *