From b4a0ba17183e1b4aa385e81e896c2a95671a40b2 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 16 Oct 2013 08:59:57 +0000 Subject: Add a 'deleteModule' method to the Linker class. This deletes the Module ivar instead of having the LTO code generater do it. It also sets the pointer to 'NULL', so that if it's used again it will abort quickly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192778 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Linker') diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index b343b1ce8f..8f2200e4ea 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1352,6 +1352,11 @@ Linker::Linker(Module *M) : Composite(M) { Linker::~Linker() { } +void Linker::deleteModule() { + delete Composite; + Composite = NULL; +} + bool Linker::linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg) { ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src, Mode); if (TheLinker.run()) { -- cgit v1.2.3