[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Thu May 9 07:54:32 PDT 2024
================
@@ -71,12 +71,9 @@ ProgramStateRef setErrnoState(ProgramStateRef State, ErrnoCheckState EState);
/// Clear state of errno (make it irrelevant).
ProgramStateRef clearErrnoState(ProgramStateRef State);
-/// Determine if a `Decl` node related to 'errno'.
-/// This is true if the declaration is the errno variable or a function
-/// that returns a pointer to the 'errno' value (usually the 'errno' macro is
-/// defined with this function). \p D is not required to be a canonical
-/// declaration.
-bool isErrno(const Decl *D);
+/// Determine if `Call` is a call to a "magical" function that returns the
+/// location of `errno` (in environments where errno is accessed this way).
+bool isErrnoLocationCall(const CallEvent &Call);
----------------
balazske wrote:
Intent of this function was to determine if the passed `Decl` is the "errno" value (independent of how it is defined). This is now changed, but not a problem because all uses are for the function case.
https://github.com/llvm/llvm-project/pull/91531
More information about the cfe-commits
mailing list