mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
Actually free memory for the module maps
llvm-svn: 144880
This commit is contained in:
parent
667971778c
commit
5acdf59ebc
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user