From f2ca21f88f4e38996b6804dfa25fe7a72814736d Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 23 Oct 2006 23:12:26 +0000 Subject: Add removeModule(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31142 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/lto/lto.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools') 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 &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 * -- cgit v1.2.3