diff options
author | DonĂ¡t Nagy <donat.nagy@ericsson.com> | 2024-05-07 13:48:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 13:48:02 +0200 |
commit | 6d64f8e1feee014e72730a78b62d9d415df112ff (patch) | |
tree | 3bb87d13073436510208dcc2e8046e522507a8c8 /clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp | |
parent | dcc7ef3ce87d7ea1ed9e64bb91e3bb2026df9644 (diff) | |
download | llvm-6d64f8e1feee014e72730a78b62d9d415df112ff.zip llvm-6d64f8e1feee014e72730a78b62d9d415df112ff.tar.gz llvm-6d64f8e1feee014e72730a78b62d9d415df112ff.tar.bz2 |
[analyzer] Use explicit call description mode in more checkers (#90974)
This commit explicitly specifies the matching mode (C library function,
any non-method function, or C++ method) for the `CallDescription`s
constructed in various checkers.
Some code was simplified to use `CallDescriptionSet`s instead of
individual `CallDescription`s.
This change won't cause major functional changes, but isn't NFC because
it ensures that e.g. call descriptions for a non-method function won't
accidentally match a method that has the same name.
Separate commits have already performed this change in other checkers:
- easy cases: e2f1cbae45f81f3cd9a4d3c2bcf69a094eb060fa
- MallocChecker: d6d84b5d1448e4f2e24b467a0abcf42fe9d543e9
- iterator checkers: 06eedffe0d2782922e63cc25cb927f4acdaf7b30
- InvalidPtr checker: 024281d4d26344f9613b9115ea1fcbdbdba23235
... and follow-up commits will handle the remaining checkers.
My goal is to ensure that the call description mode is always explicitly
specified and eliminate (or strongly restrict) the vague "may be either
a method or a simple function" mode that's the current default.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index f9548b5..238e87a 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -189,8 +189,8 @@ public: }; // These require a bit of special handling. - CallDescription StdCopy{{"std", "copy"}, 3}, - StdCopyBackward{{"std", "copy_backward"}, 3}; + CallDescription StdCopy{CDM::SimpleFunc, {"std", "copy"}, 3}, + StdCopyBackward{CDM::SimpleFunc, {"std", "copy_backward"}, 3}; FnCheck identifyCall(const CallEvent &Call, CheckerContext &C) const; void evalMemcpy(CheckerContext &C, const CallEvent &Call, CharKind CK) const; |