[PATCH] D121722: [AlwaysInliner] Check inliner errors even without assserts

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 11:28:01 PDT 2022


ellis added a comment.

In D121722#3383298 <https://reviews.llvm.org/D121722#3383298>, @lebedev.ri wrote:

> Essentially every unchecked assertion is followed by code that is effectively UB if the assertion should have failed but didn't run.
> Why is this case so special that we should special-case it?

This is a pretty easy way to prevent unexpected behavior when inlining goes wrong with noasserts builds, i.e., production.

1. `Res` gives a helpful error message that can be given to the user.
2. The comment for `InlineFunction()` claims that the program will be fine if it failed to inline, so continuing is perfectly safe.

> This returns false if it is not possible to inline this call.  The program is still in a well defined state if this occurs though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121722/new/

https://reviews.llvm.org/D121722



More information about the llvm-commits mailing list