[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 20 17:31:33 PDT 2022
NoQ added a comment.
Hi, looks great! I found a couple of typos and the amount of changes in tests is suspiciously low. And I want to make sure that the promise to change "arg" -> "argument" isn't lost (but I'll be happy if it's addressed in a follow-up patch).
================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:139
+ // constraint.
+ enum class DescritptionKind {
+ // The constraint is violated.
----------------
================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:719
+ ValueConstraint::DescritptionKind::Violation, C.getState(), Summary);
+ // Capitalize the firs letter b/c we want a full sentence.
+ Descr[0] = toupper(Descr[0]);
----------------
================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:755
Result += getArgDesc(ArgN);
- Result += " should not be NULL";
+ Result += DK == Violation ? " should not be NULL" : " is not NULL";
return Result.c_str();
----------------
I suspect this needs to be covered by tests.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101526/new/
https://reviews.llvm.org/D101526
More information about the cfe-commits
mailing list