From 51adb568d44540a33743dc8513053b49321f1f4c Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 13 Aug 2013 16:29:29 +0200 Subject: Free used constants if not used anymore Fixes memleak --- lib/Module/KModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Module') diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index ff13efda..7b23a9c9 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -127,6 +127,10 @@ KModule::~KModule() { ie = functions.end(); it != ie; ++it) delete *it; + for (std::map::iterator it=constantMap.begin(), + itE=constantMap.end(); it!=itE;++it) + delete it->second; + delete targetData; delete module; } -- cgit 1.4.1 From 5cc2a33b94e8d9192053caf2b24cb5a0aa5494ad Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Thu, 6 Jun 2013 05:35:00 +0200 Subject: Fix unitialized value --- lib/Module/Passes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Module') diff --git a/lib/Module/Passes.h b/lib/Module/Passes.h index 0c294daa..c6e09f0f 100644 --- a/lib/Module/Passes.h +++ b/lib/Module/Passes.h @@ -64,7 +64,7 @@ public: #if LLVM_VERSION_CODE < LLVM_VERSION(2, 8) RaiseAsmPass() : llvm::ModulePass((intptr_t) &ID) {} #else - RaiseAsmPass() : llvm::ModulePass(ID) {} + RaiseAsmPass() : llvm::ModulePass(ID), TLI(0) {} #endif virtual bool runOnModule(llvm::Module &M); -- cgit 1.4.1