<p dir="ltr">Yeah that and the default construct with no arguments. I'm not wedded to the wording but thought that "unverified" seemed more helpful than "null MDNode". I'm willing to defer to anyone that has a preference though. :)</p>

<div class="gmail_quote">On Jul 23, 2013 7:32 PM, "David Blaikie" <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Jul 23, 2013 at 6:51 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br>
> Author: echristo<br>
> Date: Tue Jul 23 20:51:12 2013<br>
> New Revision: 187018<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=187018&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=187018&view=rev</a><br>
> Log:<br>
> Replace with a "null" RAUW with an assert since we'd actually like<br>
> to assume we're replacing. Clarify comments.<br>
><br>
> Modified:<br>
>     llvm/trunk/lib/IR/DebugInfo.cpp<br>
><br>
> Modified: llvm/trunk/lib/IR/DebugInfo.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=187018&r1=187017&r2=187018&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=187018&r1=187017&r2=187018&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/lib/IR/DebugInfo.cpp (original)<br>
> +++ llvm/trunk/lib/IR/DebugInfo.cpp Tue Jul 23 20:51:12 2013<br>
> @@ -327,11 +327,11 @@ unsigned DIArray::getNumElements() const<br>
>    return DbgNode->getNumOperands();<br>
>  }<br>
><br>
> -/// replaceAllUsesWith - Replace all uses of debug info referenced by<br>
> -/// this descriptor.<br>
> +/// replaceAllUsesWith - Replace all uses of the MDNode used by this<br>
> +/// type with the one in the passed descriptor.<br>
>  void DIType::replaceAllUsesWith(DIDescriptor &D) {<br>
> -  if (!DbgNode)<br>
> -    return;<br>
> +<br>
> +  assert(DbgNode && "Trying to replace an unverified type!");<br>
><br>
>    // Since we use a TrackingVH for the node, its easy for clients to manufacture<br>
>    // legitimate situations where they want to replaceAllUsesWith() on something<br>
> @@ -347,11 +347,11 @@ void DIType::replaceAllUsesWith(DIDescri<br>
>    }<br>
>  }<br>
><br>
> -/// replaceAllUsesWith - Replace all uses of debug info referenced by<br>
> -/// this descriptor.<br>
> +/// replaceAllUsesWith - Replace all uses of the MDNode used by this<br>
> +/// type with the one in D.<br>
>  void DIType::replaceAllUsesWith(MDNode *D) {<br>
> -  if (!DbgNode)<br>
> -    return;<br>
> +<br>
> +  assert(DbgNode && "Trying to replace an unverified type!");<br>
<br>
Is this (& above) the right assertion text? Since we don't actually do<br>
the verification/isFoo stuff in the ctors - the null case just happens<br>
when we construct a DIFoo from a null DbgNode - probably because the<br>
node was just null (ie: we didn't build with debug info), I think...<br>
perhaps I'm wrong, maybe they become null for other reasons?<br>
<br>
><br>
>    // Since we use a TrackingVH for the node, its easy for clients to manufacture<br>
>    // legitimate situations where they want to replaceAllUsesWith() on something<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>