[llvm] r187018 - Replace with a "null" RAUW with an assert since we'd actually like

Eric Christopher echristo at gmail.com
Tue Jul 23 19:51:28 PDT 2013


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. :)
On Jul 23, 2013 7:32 PM, "David Blaikie" <dblaikie at gmail.com> wrote:

> On Tue, Jul 23, 2013 at 6:51 PM, Eric Christopher <echristo at gmail.com>
> wrote:
> > Author: echristo
> > Date: Tue Jul 23 20:51:12 2013
> > New Revision: 187018
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=187018&view=rev
> > Log:
> > Replace with a "null" RAUW with an assert since we'd actually like
> > to assume we're replacing. Clarify comments.
> >
> > Modified:
> >     llvm/trunk/lib/IR/DebugInfo.cpp
> >
> > Modified: llvm/trunk/lib/IR/DebugInfo.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=187018&r1=187017&r2=187018&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/IR/DebugInfo.cpp (original)
> > +++ llvm/trunk/lib/IR/DebugInfo.cpp Tue Jul 23 20:51:12 2013
> > @@ -327,11 +327,11 @@ unsigned DIArray::getNumElements() const
> >    return DbgNode->getNumOperands();
> >  }
> >
> > -/// replaceAllUsesWith - Replace all uses of debug info referenced by
> > -/// this descriptor.
> > +/// replaceAllUsesWith - Replace all uses of the MDNode used by this
> > +/// type with the one in the passed descriptor.
> >  void DIType::replaceAllUsesWith(DIDescriptor &D) {
> > -  if (!DbgNode)
> > -    return;
> > +
> > +  assert(DbgNode && "Trying to replace an unverified type!");
> >
> >    // Since we use a TrackingVH for the node, its easy for clients to
> manufacture
> >    // legitimate situations where they want to replaceAllUsesWith() on
> something
> > @@ -347,11 +347,11 @@ void DIType::replaceAllUsesWith(DIDescri
> >    }
> >  }
> >
> > -/// replaceAllUsesWith - Replace all uses of debug info referenced by
> > -/// this descriptor.
> > +/// replaceAllUsesWith - Replace all uses of the MDNode used by this
> > +/// type with the one in D.
> >  void DIType::replaceAllUsesWith(MDNode *D) {
> > -  if (!DbgNode)
> > -    return;
> > +
> > +  assert(DbgNode && "Trying to replace an unverified type!");
>
> Is this (& above) the right assertion text? Since we don't actually do
> the verification/isFoo stuff in the ctors - the null case just happens
> when we construct a DIFoo from a null DbgNode - probably because the
> node was just null (ie: we didn't build with debug info), I think...
> perhaps I'm wrong, maybe they become null for other reasons?
>
> >
> >    // Since we use a TrackingVH for the node, its easy for clients to
> manufacture
> >    // legitimate situations where they want to replaceAllUsesWith() on
> something
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130723/f2b1a18c/attachment.html>


More information about the llvm-commits mailing list