Skip to content
Snippets Groups Projects
Commit 09fe1bb6 authored by Douglas Gregor's avatar Douglas Gregor
Browse files

Actually free memory for the module maps

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144880 91177308-0d34-0410-b5e6-96231b3b80d8
parent 35f9ae6d
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,9 @@ public:
: Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent),
UmbrellaHeader(0), IsExplicit(IsExplicit) {
}
~Module();
/// \brief Determine whether this module is a submodule.
bool isSubModule() const { return Parent != 0; }
......
......@@ -31,6 +31,15 @@ using namespace clang;
// Module
//----------------------------------------------------------------------------//
ModuleMap::Module::~Module() {
for (llvm::StringMap<Module *>::iterator I = SubModules.begin(),
IEnd = SubModules.end();
I != IEnd; ++I) {
delete I->getValue();
}
}
std::string ModuleMap::Module::getFullModuleName() const {
llvm::SmallVector<StringRef, 2> Names;
......@@ -72,6 +81,12 @@ ModuleMap::ModuleMap(FileManager &FileMgr, const DiagnosticConsumer &DC) {
}
ModuleMap::~ModuleMap() {
for (llvm::StringMap<Module *>::iterator I = Modules.begin(),
IEnd = Modules.end();
I != IEnd; ++I) {
delete I->getValue();
}
delete SourceMgr;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment