<div dir="ltr">(& now I see your follow-up commit... :))</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 9:05 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Nov 20, 2014 at 7:46 AM, Frederic Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: friss<br>
Date: Thu Nov 20 09:46:59 2014<br>
New Revision: 222433<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=222433&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=222433&view=rev</a><br>
Log:<br>
Prepare for the DIBuilder populating DISubprogram's Variables with null.<br>
<br>
This is a followup to r222373. A better solution to the problem solved<br>
there is to not create the leaked nodes at all (we know that they will<br>
never be used for forward declared functions anyway). To avoid bot<br>
breakage in the interval between the cfe and llvm commits, add a check<br>
that the nMDNode is not null before deleting it. This code can completely<br>
go away after the LLVM part is in.<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=222433&r1=222432&r2=222433&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=222433&r1=222432&r2=222433&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Nov 20 09:46:59 2014<br>
@@ -3417,7 +3417,8 @@ void CGDebugInfo::finalize() {<br>
     // to get RAUWed upon DIBuilder finalization. Do not leak these<br>
     // nodes for the temporary functions we are about to delete.<br>
     if (FwdDecl.isSubprogram())<br>
-      llvm::MDNode::deleteTemporary(llvm::DISubprogram(FwdDecl).getVariablesNodes());<br>
+      if (llvm::MDNode *Vars = llvm::DISubprogram(FwdDecl).getVariablesNodes())<br>
+        llvm::MDNode::deleteTemporary(Vars);<br></blockquote></div></div><div><br>Why do you need this deleteTemporary at all? We must always RAUW the variables node somewhere (where?) and can delete this temporary node there (without the need for extra/duplicate conditionals) maybe? Yeah, this seems like it could be handled down in DIBuilder::finalize when it RAUW's the variable node (& it'd be more symmetric that way - DIBuilder creates them, DIBuilder destroys them, Clang (& any other DIBuilder client) doesn't know/care about them)<br> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
     FwdDecl.replaceAllUsesWith(CGM.getLLVMContext(),<br>
                                llvm::DIDescriptor(cast<llvm::MDNode>(VH)));<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div>