[cfe-commits] r141479 - in /cfe/trunk/lib/CodeGen: CodeGenModule.cpp TargetInfo.cpp
Ted Kremenek
kremenek at apple.com
Fri Oct 7 22:28:26 PDT 2011
Author: kremenek
Date: Sat Oct 8 00:28:26 2011
New Revision: 141479
URL: http://llvm.org/viewvc/llvm-project?rev=141479&view=rev
Log:
Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=141479&r1=141478&r2=141479&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Oct 8 00:28:26 2011
@@ -117,6 +117,7 @@
delete ObjCRuntime;
delete OpenCLRuntime;
delete CUDARuntime;
+ delete TheTargetCodeGenInfo;
delete &ABI;
delete TBAA;
delete DebugInfo;
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=141479&r1=141478&r2=141479&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Sat Oct 8 00:28:26 2011
@@ -3217,9 +3217,6 @@
if (TheTargetCodeGenInfo)
return *TheTargetCodeGenInfo;
- // For now we just cache the TargetCodeGenInfo in CodeGenModule and don't
- // free it.
-
const llvm::Triple &Triple = getContext().getTargetInfo().getTriple();
switch (Triple.getArch()) {
default:
More information about the cfe-commits
mailing list