llvm.org GIT mirror llvm / 2a4dd68
Fix typo. Add more comment. Avoid extra hash_map search. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31144 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 13 years ago
1 changed file(s) with 8 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
101101 findExternalRefs(c->getOperand(i), references, mangler);
102102 }
103103
104 /// If Moduel with InputFilename is available then remove it.
104 /// If Module with InputFilename is available then remove it from allModules
105 /// and call delete on it.
105106 void
106107 LTO::removeModule (const std::string &InputFilename)
107108 {
108109 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 }
110 if (pos == allModules.end())
111 return;
112
113 Module *m = pos->second;
114 allModules.erase(pos);
115 delete m;
114116 }
115117
116118 /// InputFilename is a LLVM bytecode file. If Module with InputFilename is