On Thu, Nov 20, 2014 at 7:46 AM, Frederic Riss <[email protected]> wrote:
> Author: friss > Date: Thu Nov 20 09:46:59 2014 > New Revision: 222433 > > URL: http://llvm.org/viewvc/llvm-project?rev=222433&view=rev > Log: > Prepare for the DIBuilder populating DISubprogram's Variables with null. > > This is a followup to r222373. A better solution to the problem solved > there is to not create the leaked nodes at all (we know that they will > never be used for forward declared functions anyway). To avoid bot > breakage in the interval between the cfe and llvm commits, add a check > that the nMDNode is not null before deleting it. This code can completely > go away after the LLVM part is in. > > Modified: > cfe/trunk/lib/CodeGen/CGDebugInfo.cpp > > Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=222433&r1=222432&r2=222433&view=diff > > ============================================================================== > --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original) > +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Nov 20 09:46:59 2014 > @@ -3417,7 +3417,8 @@ void CGDebugInfo::finalize() { > // to get RAUWed upon DIBuilder finalization. Do not leak these > // nodes for the temporary functions we are about to delete. > if (FwdDecl.isSubprogram()) > - > llvm::MDNode::deleteTemporary(llvm::DISubprogram(FwdDecl).getVariablesNodes()); > + if (llvm::MDNode *Vars = > llvm::DISubprogram(FwdDecl).getVariablesNodes()) > + llvm::MDNode::deleteTemporary(Vars); > 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) > > FwdDecl.replaceAllUsesWith(CGM.getLLVMContext(), > > llvm::DIDescriptor(cast<llvm::MDNode>(VH))); > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
