[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri May 10 02:44:58 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);
----------------
NagyDonat wrote:

Yes, I see that `isErrno` was intended for a different behavior; but its variable declaration handling "side" became unused, so I deleted that and modified the remaining function-handling case to accept a call instead of a declaration.

https://github.com/llvm/llvm-project/pull/91531


More information about the cfe-commits mailing list