[PATCH] D109443: [LV] Lazy creation of runtime checks
Evgeniy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 26 23:49:44 PDT 2021
ebrevnov added a comment.
In D109443#3022641 <https://reviews.llvm.org/D109443#3022641>, @fhahn wrote:
>> Also this facilitates future development.
>
> Could you provide a few more details on this, i.e. what the drawbacks of explicit initialization are?
Honestly, I find current API a bit confusing. I see the following drawbacks in priority:
1. Current API is a potential source of future errors since it is easy to misplace a call to Create() or miss it completely. There is no easy way to detect the mistake.
2. Negatively affects end user experience if the existing API.
3. Requires code changes which could be avoided otherwise.
In the end, why should we care about explicit initialization if everything can be done automatically behind the scene?
> Personally I find the code easier to follow if things happen explicitly. Are you anticipating the need to generate the runtime checks at different points?
In D75981 <https://reviews.llvm.org/D75981>, you already introducing two new calls to Create() and move one existing call to new place. All these changes could be avoided with lazy approach.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109443/new/
https://reviews.llvm.org/D109443
More information about the llvm-commits
mailing list