[llvm] r233030 - DebugInfo: Overload get() in DIDescriptor subclasses
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Mar 23 15:16:38 PDT 2015
> On 2015-Mar-23, at 15:13, David Blaikie <dblaikie at gmail.com> wrote:
>
>
>
> 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?
Hmm, maybe not.
>
> 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
When I get a chance I'll remove the `get()` from `DIDescriptor`
(and the subclasses) and see what fails to compile.
More information about the llvm-commits
mailing list