Displaying 13 results from an estimated 13 matches for "_or_null".
2019 Apr 06
4
[RFC] Should we add isa_or_null<>?
...Chris Lattner <clattner at nondot.org>
>> wrote:
>> >
>> >
>> >
>> > > On Apr 4, 2019, at 5:37 AM, Don Hinton via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>> > >
>> > > I'd like to propose adding `isa_or_null<>` to replace the following
>> usage pattern that's relatively common in conditionals:
>> > >
>> > > var && isa<T>(var) =>> isa_or_null<T>(var)
>> > >
>> > > And in particular when `var` is a method call w...
2019 Apr 04
4
[RFC] Should we add isa_or_null<>?
On Thu, Apr 4, 2019 at 12:58 PM Chris Lattner <clattner at nondot.org> wrote:
>
>
>
> > On Apr 4, 2019, at 5:37 AM, Don Hinton via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> >
> > I'd like to propose adding `isa_or_null<>` to replace the following usage pattern that's relatively common in conditionals:
> >
> > var && isa<T>(var) =>> isa_or_null<T>(var)
> >
> > And in particular when `var` is a method call which might be expensive, e.g.:
> >
>...
2019 Apr 10
2
[RFC] Should we add isa_or_null<>?
...> On Thu, Apr 4, 2019 at 12:58 PM Chris Lattner <clattner at nondot.org> wrote:
> >
> >
> >
> > > On Apr 4, 2019, at 5:37 AM, Don Hinton via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> > >
> > > I'd like to propose adding `isa_or_null<>` to replace the following usage pattern that's relatively common in conditionals:
> > >
> > > var && isa<T>(var) =>> isa_or_null<T>(var)
> > >
> > > And in particular when `var` is a method call which might be expensi...
2019 Apr 07
2
[RFC] Should we add isa_or_null<>?
...rote:
>>>> >
>>>> >
>>>> >
>>>> > > On Apr 4, 2019, at 5:37 AM, Don Hinton via llvm-dev <
>>>> llvm-dev at lists.llvm.org> wrote:
>>>> > >
>>>> > > I'd like to propose adding `isa_or_null<>` to replace the following
>>>> usage pattern that's relatively common in conditionals:
>>>> > >
>>>> > > var && isa<T>(var) =>> isa_or_null<T>(var)
>>>> > >
>>>> > > And in...
2019 Apr 04
2
[RFC] Should we add isa_or_null<>?
On Thu, Apr 4, 2019 at 10:30 AM David Greene <dag at cray.com> wrote:
> I don't think that's a correct replacement.
>
> if (var && isa<T>(var)) {
> ...
> }
>
> is not the same as:
>
> if (isa_or_null<T>(var)) {
> ...
> }
>
> at least according to what "isa_or_null" conveys to me.
>
This is the same convention used by the existing "_or_null" varieties,
i.e., "cast_or_null" and "dyn_cast_or_null". They accept a null and
propagate i...
2019 Apr 04
2
[RFC] Should we add isa_or_null<>?
...ded a patch, temporarily using the name Chris suggested. Please let
me know what you think.
https://reviews.llvm.org/D60291
thanks...
don
On Thu, Apr 4, 2019 at 2:55 PM David Greene <dag at cray.com> wrote:
> Don Hinton <hintonda at gmail.com> writes:
>
> > > if (isa_or_null<T>(var)) {
> > > ...
> > > }
> > >
> > > at least according to what "isa_or_null" conveys to me.
> >
> > This is the same convention used by the existing "_or_null" varieties,
> > i.e., "cast_or_null" and...
2019 Apr 07
2
[RFC] Should we add isa_or_null<>?
...n assertion than a predicate, in which case `isa<T>(not_null(v))` reads like it has the exact same semantics that `isa<T>(v)` has currently—asserts that `v` is not null.
I don't dispute that you can *make* it have the desired semantics, it just won't *look* that way.
maybe `isaT_or_null<Foo>(v)` ? Still looks awkward but maybe less naively misleading.
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Zachary Turner via llvm-dev
Sent: Saturday, April 06, 2019 10:15 PM
To: Mehdi AMINI
Cc: LLVM Development List; Aaron Ballman
Subject: Re: [llvm-dev] [RFC...
2019 Apr 04
2
[RFC] Should we add isa_or_null<>?
On Thu, Apr 4, 2019 at 6:29 PM Craig Topper <craig.topper at gmail.com> wrote:
> There are a handful of places in LLVM that dosomething like if
> (dyn_cast_or_null<UndefValue>(P->hasConstantValue()))
>
Yes, I've seen those, but while working on a new checker, I was advised
that replacing `X && isa<Y>(X)` with `dyn_cast_or_null<Y>(X)` was
suboptimal, and it was suggested something like a `isa_or_null` style
operator would b...
2019 Apr 05
2
[RFC] Should we add isa_or_null<>?
On Thu, Apr 4, 2019 at 7:10 PM Craig Topper <craig.topper at gmail.com> wrote:
> Agreed that the new isa_or_null style is better. Just wanted mention the
> other style so we know we should migrate those to the new one.
>
I have a checker under review that could be enhanced to do that -- though
it currently replaces `X->foo() && isa<Y>(X->foo())` with
`dyn_cast_or_null<Y>(X->...
2019 Apr 04
4
[RFC] Should we add isa_or_null<>?
I'd like to propose adding `isa_or_null<>` to replace the following usage
pattern that's relatively common in conditionals:
var && isa<T>(var) =>> isa_or_null<T>(var)
And in particular when `var` is a method call which might be expensive,
e.g.:
X->foo() && isa<T>(X->foo())...
2019 Apr 22
3
[RFC] Should we add isa_or_null<>?
...t.org>
>> wrote:
>> > >
>> > >
>> > >
>> > > > On Apr 4, 2019, at 5:37 AM, Don Hinton via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>> > > >
>> > > > I'd like to propose adding `isa_or_null<>` to replace the
>> following usage pattern that's relatively common in conditionals:
>> > > >
>> > > > var && isa<T>(var) =>> isa_or_null<T>(var)
>> > > >
>> > > > And in particular when...
2019 May 05
3
[RFC] Should we add isa_or_null<>?
+1 on not adding the new API
On Sat, May 4, 2019, 11:51 AM David Blaikie via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> +1, if we're voting. I don't think it adds to the readability of code
> for me personally.
>
> On Sat, May 4, 2019 at 11:47 AM Chandler Carruth via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> >
> > On Mon, Apr 29, 2019,
2019 Apr 05
2
[RFC] Should we add isa_or_null<>?
+1 for "isa_nonnull"
--paulr
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Hubert Tong via llvm-dev
Sent: Friday, April 05, 2019 12:10 AM
To: Aaron Ballman
Cc: LLVM Development List
Subject: Re: [llvm-dev] [RFC] Should we add isa_or_null<>?
On Thu, Apr 4, 2019 at 11:15 PM Aaron Ballman via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:
On Thu, Apr 4, 2019 at 12:58 PM Chris Lattner <clattner at nondot.org<mailto:clattner at nondot.org>> wrote:
>
>
>
> > O...