[PATCH] D121045: [analyzer][NFC] Merge similar conditional paths
Shivam Rajput via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 6 07:37:45 PST 2022
phyBrackets updated this revision to Diff 413300.
phyBrackets added a comment.
query the opcode only once and reuse it
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121045/new/
https://reviews.llvm.org/D121045
Files:
clang/docs/DataFlowAnalysisIntro.md
clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
Index: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
@@ -107,11 +107,8 @@
dyn_cast<BinaryOperator>(Ex->IgnoreParenCasts());
if (!BO)
break;
- if (BO->getOpcode() == BO_Assign) {
- Ex = BO->getRHS();
- continue;
- }
- if (BO->getOpcode() == BO_Comma) {
+ BinaryOperatorKind BO_AssignOrComma = BO->getOpcode();
+ if (BO_AssignOrComma == BO_Assign || BO_AssignOrComma == BO_Comma) {
Ex = BO->getRHS();
continue;
}
Index: clang/docs/DataFlowAnalysisIntro.md
===================================================================
--- clang/docs/DataFlowAnalysisIntro.md
+++ clang/docs/DataFlowAnalysisIntro.md
@@ -287,7 +287,7 @@
(Note that there are other ways to write this equation that produce higher
precision analysis results. The trick is to keep exploring the execution paths
-separately and delay joining until later. Hoowever, we won't discuss those
+separately and delay joining until later. However, we won't discuss those
variations here.)
To make a conclusion about all paths through the program, we repeat this
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121045.413300.patch
Type: text/x-patch
Size: 1287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220306/eceba954/attachment-0001.bin>
More information about the cfe-commits
mailing list