Remove the null pointer check on Callee since it is guaranteed to pass by the check
at the top of the loop which continues if Callee is null. While this change is somewhat
trivial, for what it's worth this check triggers Coverity warnings because it implies that
Callee might be null at this point even though it is dereferenced in the preceding code.
Details
- Reviewers
mtrofin kazu - Commits
- rG795aebf38831: [Inliner][NFC] Remove redundant nullptr check
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm very new to this and trying to get my toes wet in the review process with some very minor non-controversial changes. Please let me know if I've made any mistakes in the process.
Would adding an assert(Callee && "Expected to be non-null due to check at the start of the loop") (or something like that) above the if-check make Coverity happy?
Either removing the check completely or moving it from the if to an assert will make Coverity happy. Would the assert be preferable to complete removal from a stylistic/readability perspective?
my preference would be to have an assert, the nullcheck is quite far above, and who knows what future changes will look like; an assert close to the use communicates to the future developer that "this here is intentionally assumed so, because (the comment)".
@mtrofin I think I do not have commit access and therefore need you to commit this change on my behalf, is that right?
clang-format not found in user’s local PATH; not linting file.