[PATCH] D45657: [Instruction, BasicBlock] Add is_none_of and skipInsts helper functions.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 17 12:36:02 PDT 2018


vsk added a comment.

In https://reviews.llvm.org/D45657#1070122, @fhahn wrote:

> In https://reviews.llvm.org/D45657#1068834, @vsk wrote:
>
> > I like the direction this is going in :).
> >
> > I think having an API like 'instructions_no_debug' or similar in BasicBlock would make the interface friendlier. For one, it'd signal to readers that skipping debug intrinsics is an established pattern. Also, I think it would be easier to change if, e.g we wanted update all existing users of the API to skip lifetime intrinsics too.
>
>
> Thanks for the feedback! I'll add a instructionsNoDebug function. I tried to make skipInsts as flexible as possible, but I am not sure if the flexibility is really needed. Should I remove it for now?


It should be possible to implement instructionsNoDebug succinctly without skipInsts, so I'd suggest removing it.

I think the is_{any,none}_of predicates could be generally useful, though. It'd make sense to add them as a follow-up.


https://reviews.llvm.org/D45657





More information about the llvm-commits mailing list