diff options
author | DonĂ¡t Nagy <donat.nagy@ericsson.com> | 2024-05-15 10:53:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 10:53:54 +0200 |
commit | ca4a405232cf170f20a2f111bf72beab82095935 (patch) | |
tree | cbfc73db76b07bd939b4d598ada397432a6335ba /llvm/lib/Support/BinaryStreamWriter.cpp | |
parent | afba3daf822c839db1be40464041307679c803a9 (diff) | |
download | llvm-ca4a405232cf170f20a2f111bf72beab82095935.zip llvm-ca4a405232cf170f20a2f111bf72beab82095935.tar.gz llvm-ca4a405232cf170f20a2f111bf72beab82095935.tar.bz2 |
[analyzer] Refactor recognition of the errno getter functions (#91531)
There are many environments where `errno` is a macro that expands to
something like `(*__errno())` (different standard library
implementations use different names instead of "__errno").
In these environments the ErrnoModeling checker creates a symbolic
region which will be used to represent the return value of this "get the
location of errno" function.
Previously this symbol was only created when the checker was able to
find the declaration of the "get the location of errno" function; but
this commit eliminates the complex logic that was responsible for this
and always creates the symbolic region when `errno` is not available as
a "regular" global variable.
This significantly simplifies a code and only introduces a minimal
performance reduction (one extra symbol) in the case when `errno` is not
declared (neither as a variable nor as a function).
In addition to this simplification, this commit specifies that the
`CallDescription`s for the "get the location of errno" functions are
matched in `CDM::CLibrary` mode. (This was my original goal, but I was
sidetracked by resolving a FIXME above the `CallDescriptionSet` in
`ErrnoModeling.cpp`.)
This change is very close to being NFC, but it fixes weird corner cases
like the handling of a C++ method that happens to be named "__errno()"
(previously it could've been recognized as an errno location getter
function).
Diffstat (limited to 'llvm/lib/Support/BinaryStreamWriter.cpp')
0 files changed, 0 insertions, 0 deletions