When we build clang without asserts we should still check the result of
InlineFunction() to be sure there wasn't an error. Otherwise we could
incorrectly merge attributes in the next line.
This also removes a redundent call to getCaller().
Differential D121722
[AlwaysInliner] Check inliner errors even without assserts ellis on Mar 15 2022, 11:15 AM. Authored by
Details When we build clang without asserts we should still check the result of This also removes a redundent call to getCaller().
Diff Detail
Event TimelineComment Actions Essentially every unchecked assertion is followed by code that is effectively UB if the assertion should have failed but didn't run. Comment Actions This is a pretty easy way to prevent unexpected behavior when inlining goes wrong with noasserts builds, i.e., production.
Comment Actions Either inlining always succeeds and we assert, or inlining can fail and we should never assert. I do think that it can fail, and you should be able to add a test for it. There's a bunch of checks at the start of InlineFunction that should be usable for that purpose, e.g. a personality function mismatch. Comment Actions Add a test case for functions with the alwaysinline attribute that cannot be inlined and emit a remark instead of outputting directly to errs().
|
Should it be moved down after InlineResult is successful?
This is about remarking a success case which we want only when it succeeded.