<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 10 Sep 2014, at 18:21, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Wed, Sep 10, 2014 at 9:03 AM, Frederic Riss<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:friss@apple.com" target="_blank" class="">friss@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Author: friss<br class="">Date: Wed Sep 10 11:03:14 2014<br class="">New Revision: 217514<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=217514&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=217514&view=rev</a><br class="">Log:<br class="">Fix comments of createReplaceableForwardDecl() and createForwardDecl().<br class=""><br class="">Noticed while trying to understand how the merge of forward decalred types<br class="">and defintions work.<br class=""><br class="">Reviewers: echristo, dblaikie, aprantl<br class=""><br class="">Subscribers: llvm-commits<br class=""><br class="">Differential Revision:<span class="Apple-converted-space"> </span><a href="http://reviews.llvm.org/D5291" target="_blank" class="">http://reviews.llvm.org/D5291</a><br class=""><br class="">Modified:<br class="">   <span class="Apple-converted-space"> </span>llvm/trunk/lib/IR/DIBuilder.cpp<br class=""><br class="">Modified: llvm/trunk/lib/IR/DIBuilder.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=217514&r1=217513&r2=217514&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=217514&r1=217513&r2=217514&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/IR/DIBuilder.cpp (original)<br class="">+++ llvm/trunk/lib/IR/DIBuilder.cpp Wed Sep 10 11:03:14 2014<br class="">@@ -879,8 +879,7 @@ DIBasicType DIBuilder::createUnspecified<br class="">   return DIBasicType();<br class=""> }<br class=""><br class="">-/// createForwardDecl - Create a temporary forward-declared type that<br class="">-/// can be RAUW'd if the full type is seen.<br class="">+/// createForwardDecl - Create a permanent forward-declared type.<br class=""> DICompositeType<br class=""> DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,<br class="">                             <span class="Apple-converted-space"> </span>DIFile F, unsigned Line, unsigned RuntimeLang,<br class="">@@ -914,7 +913,7 @@ DIBuilder::createForwardDecl(unsigned Ta<br class="">   return RetTy;<br class=""> }<br class=""><br class="">-/// createForwardDecl - Create a temporary forward-declared type that<br class="">+/// createReplaceableForwardDecl - Create a temporary forward-declared type that<br class=""> /// can be RAUW'd if the full type is seen.<br class=""></blockquote><div class=""><br class=""></div><div class="">FWIW (either just for your information, or something you can enshrine in a comment): Because this creates a temporary (perhaps we should replace "replaceable" with "temporary") node, it /must/ be RAUW'd at some point, sooner or later. It isn't optional.</div><div class=""> </div></div></div></blockquote><div><br class=""></div><div>Interesting. I was just working on another patch that adds this kind of temporaries for function and variable forward definitions (for the missed imported decl and my default argument attributes). The comment of MDNode::getTemporary() reads:</div><div><br class=""></div><div><div>  /// getTemporary - Return a temporary MDNode, for use in constructing</div><div>  /// cyclic MDNode structures. A temporary MDNode is not uniqued,</div><div>  /// may be RAUW'd, and must be manually deleted with deleteTemporary.</div><div class=""><br class=""></div><div class="">I had read the ‘must be manually deletes’ part as ‘if you want to get rid of if, please call deleteTemporary’ but you’re saying that these nodes must not survive the code generation or something will go wrong?</div><div class=""><br class=""></div><div class="">Fred</div><div class=""><br class=""></div></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"> DICompositeType DIBuilder::createReplaceableForwardDecl(<br class="">     unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F, unsigned Line,<br class="">@@ -942,7 +941,7 @@ DICompositeType DIBuilder::createReplace<br class="">   MDNode *Node = MDNode::getTemporary(VMContext, Elts);<br class="">   DICompositeType RetTy(Node);<br class="">   assert(RetTy.isCompositeType() &&<br class="">-         "createForwardDecl result should be a DIType");<br class="">+         "createReplaceableForwardDecl result should be a DIType");<br class="">   if (!UniqueIdentifier.empty())<br class="">     retainType(RetTy);<br class="">   return RetTy;<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></blockquote></div></div></blockquote></div><br class=""></body></html>