search for: or_nul

Displaying 3 results from an estimated 3 matches for "or_nul".

Did you mean: or_null
2019 Apr 07
2
[RFC] Should we add isa_or_null<>?
I read `isa<T>(or_null(v))` as "v is a T or nullptr", which does not match the implementation semantics "v is a T and not null". On Sat, Apr 6, 2019 at 9:31 PM Zachary Turner <zturner at google.com> wrote: > Sorry, brain isn't fully working. I meant to call the function / type > `...
2019 Apr 07
2
[RFC] Should we add isa_or_null<>?
...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] [RF...
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...