[all-commits] [llvm/llvm-project] 94609a: [Support] Remove an unnecessary include (#123182)
Martin Storsjö via All-commits
all-commits at lists.llvm.org
Thu Jan 16 12:47:43 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 94609aee73d7123bc9afe002a4987d06eba9f452
https://github.com/llvm/llvm-project/commit/94609aee73d7123bc9afe002a4987d06eba9f452
Author: Martin Storsjö <martin at martin.st>
Date: 2025-01-16 (Thu, 16 Jan 2025)
Changed paths:
M llvm/include/llvm/Support/FileSystem.h
M llvm/lib/Support/ErrorHandling.cpp
Log Message:
-----------
[Support] Remove an unnecessary include (#123182)
In 1e53f9523d3d5fcb2993b4b6540f1ed8d743380b, the FileSystem.h header was
changed to always include <sys/stat.h>, while it previously only was
included if HAVE_SYS_STAT_H was defined.
HAVE_SYS_STAT_H was defined in llvm/Config/config.h, while FileSystem.h
only included llvm/Config/llvm-config.h. Thus, <sys/stat.h> was only
being included in some but not all cases.
The change to always include <sys/stat.h> broke compiling LLDB for MinGW
targets, because the MinGW <sys/stat.h> header adds an "#define fstat
_fstat64" define, which breaks LLDBs use of a struct with a member named
"fstat".
Remove the include of <sys/stat.h> in FileSystem.h, as it seems to not
be necessary in practice, fixing compilation of LLDB for MinGW targets.
Change one instance of defined(_MSC_VER) into defined(_WIN32) in
ErrorHandling.cpp to get <io.h> included; this source file did include
config.h before transitively including FileSystem.h. The include of
<sys/stat.h> in FileSystem.h would bring in <io.h> (needed for
::write()), explaining why this ifdef didn't need to cover MinGW before.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list