From: Ted Kremenek Date: Sat, 8 Oct 2011 05:28:26 +0000 (+0000) Subject: Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0628b724ff68105dc88af00a39f859447f22981e;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141479 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d8b9c9d853..aab513fdce 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -117,6 +117,7 @@ CodeGenModule::~CodeGenModule() { delete ObjCRuntime; delete OpenCLRuntime; delete CUDARuntime; + delete TheTargetCodeGenInfo; delete &ABI; delete TBAA; delete DebugInfo; diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 91802d3b3a..ce729ce8da 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -3217,9 +3217,6 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() { 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: