[PATCH] D153589: [NFC] Initialize pointer fields and remove a needless null check.
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 22 14:24:53 PDT 2023
erichkeane added inline comments.
================
Comment at: clang/lib/Analysis/CFG.cpp:4156
// CFG generation for unevaluated operands.
- if (S && !S->isTypeDependent() && S->isPotentiallyEvaluated())
+ if (!S->isTypeDependent() && S->isPotentiallyEvaluated())
return VisitChildren(S);
----------------
I get that we're counting on the dereference on 4145 to have made this check irrelevant, but are we sure that we KNOW that "S" is non-null here otherwise? That is, is the bug actually 4145 doing 'alwaysAdd' without checking vs the unnecessary check here?
================
Comment at: clang/lib/CodeGen/CGObjCGNU.cpp:59
LazyRuntimeFunction()
- : CGM(nullptr), FunctionName(nullptr), Function(nullptr) {}
+ : CGM(nullptr), FTy(nullptr), FunctionName(nullptr), Function(nullptr) {}
----------------
I would suggest instead making these inline initialization rather than here (that is, CGM = nullptr on line 49, etc).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153589/new/
https://reviews.llvm.org/D153589
More information about the cfe-commits
mailing list