[llvm] r233030 - DebugInfo: Overload get() in DIDescriptor subclasses

David Blaikie dblaikie at gmail.com
Mon Mar 23 15:13:46 PDT 2015


On Mon, Mar 23, 2015 at 3:09 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

>
> > On 2015-Mar-23, at 15:00, David Blaikie <dblaikie at gmail.com> wrote:
> >
> >
> >    void replaceFunction(Function *F) {
> > -    if (auto *N = getRaw())
> > +    if (auto *N = get())
> >
> > Can we just write that as "auto *N = *this" (not sure if that's better -
> but I'm wondering how much we need the 'get()' function?)?
>
> I don't mind too much either way, but I find `get()` to be a little
> clearer than `*this`.  I feel stronger in other spots, where
> `get()->` would be changed to `(*this)->`.  It's a little too easy
> to misread that, IMO.


Is that misreading even likely to be ambiguous/misleading?

My thought process here is that if I had a local variable of this type:

  DIFoo f;

I would write:

  if (auto *N = f);

or

  f->x

I wouldn't use 'get' - so I tend to not use it when implementing the class
(or otherwise dealing with pointers) either.

But no worries - just a thought. Totally up to you.

- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150323/661958c0/attachment.html>


More information about the llvm-commits mailing list