summaryrefslogtreecommitdiff
path: root/clang/lib/Lex/InitHeaderSearch.cpp
AgeCommit message (Collapse)Author
2025-07-15Remove Native Client support (#133661)Brad Smith
Remove the Native Client support now that it has finally reached end of life.
2025-06-20[clang] Add managarm support (#144791)no92
This is a repost of the quickly reverted #139271. The failing buildbot tests have been fixed and pass on my machine now.
2025-06-17Revert "[clang] Add managarm support" (#144514)Aaron Ballman
Reverts llvm/llvm-project#139271 There are multiple failing build bots: https://lab.llvm.org/buildbot/#/builders/10/builds/7482 https://lab.llvm.org/buildbot/#/builders/11/builds/17473
2025-06-17[clang] Add managarm support (#139271)no92
This PR is part of a series to upstream managarm support, as laid out in the [RFC](https://discourse.llvm.org/t/rfc-new-proposed-managarm-support-for-llvm-and-clang-87845/85884/1). This PR is a follow-up to #87845 and #138854.
2025-05-09[Clang] [Driver] add a Cygwin ToolChain (#135691)jeremyd2019
Add a new Cygwin toolchain that just goes through the motions to initialize the Generic_GCC base properly. This allows removing some old, almost certainly wrong hard-coded paths from Lex/InitHeaderSearch.cpp. MSYS2 (GCC triple (arch)-pc-msys) is a fork of Cygwin (GCC triple (arch)-pc-cygwin), and this driver can be used for either. Add a simple test for this driver.
2025-05-08[clang][Darwin] Remove legacy framework search path logic in the frontend ↵Ian Anderson
(#138234) Move the Darwin framework search path logic from InitHeaderSearch::AddDefaultIncludePaths to DarwinClang::AddClangSystemIncludeArgs. Add a new -internal-iframework cc1 argument to support the tool chain adding these paths. Now that the tool chain is adding search paths via cc1 flag, they're only added if they exist, so the Preprocessor/cuda-macos-includes.cu test is no longer relevant. Change Driver/driverkit-path.c and Driver/darwin-subframeworks.c to do -### style testing similar to the darwin-header-search and darwin-embedded-search-paths tests. Rename darwin-subframeworks.c to darwin-framework-search-paths.c and have it test all framework search paths, not just SubFrameworks. Add a unit test to validate that the myriad of search path flags result in the expected search path list. Fixes https://github.com/llvm/llvm-project/issues/75638
2025-01-07[Darwin][Driver][clang] apple-none-macho orders the resource directory after ↵Ian Anderson
internal-externc-isystem when nostdlibinc is used (#122035) Embedded development often needs to use a different C standard library, replacing the existing one normally passed as -internal-externc-isystem. This works fine for an apple-macos target, but apple-none-macho doesn't work because the MachO driver doesn't implement AddClangSystemIncludeArgs to add the resource directory as -internal-isystem like most other drivers do. Move most of the search path logic from Darwin and DarwinClang down into an AppleMachO toolchain between the MachO and Darwin toolchains. Also define __MACH__ for apple-none-macho, as Swift expects all MachO targets to have that defined.
2025-01-07Revert "[Darwin][Driver][clang] apple-none-macho orders the resource ↵Nico Weber
directory after internal-externc-isystem when nostdlibinc is used (#120507)" This reverts commit 653a54727eaa18c43447ad686c987db67f1dda74. Breaks tests, see https://github.com/llvm/llvm-project/pull/120507#issuecomment-2575246281
2025-01-06[Darwin][Driver][clang] apple-none-macho orders the resource directory after ↵Ian Anderson
internal-externc-isystem when nostdlibinc is used (#120507) Embedded development often needs to use a different C standard library, replacing the existing one normally passed as -internal-externc-isystem. This works fine for an apple-macos target, but apple-none-macho doesn't work because the MachO driver doesn't implement AddClangSystemIncludeArgs to add the resource directory as -internal-isystem like most other drivers do. Move most of the search path logic from Darwin and DarwinClang down into an AppleMachO toolchain between the MachO and Darwin toolchains. Also define \_\_MACH__ for apple-none-macho, as Swift expects all MachO targets to have that defined.
2024-12-21[clang][driver] Cleanup UEFI toolchain driver (#111473)Prabhuk
Updating UEFI header includes to not include system include directories, adding includes from compiler resource directory and minor cleanups.
2024-11-16[Lex] Remove unused includes (NFC) (#116460)Kazu Hirata
Identified with misc-include-cleaner.
2024-11-15[Clang][Darwin] Introduce `SubFrameworks` as a SDK default location (#115048)Cyndy Ishida
* Have clang always append & pass System/Library/SubFrameworks when determining default sdk search paths. * Teach clang-installapi to traverse there for framework input. * Teach llvm-readtapi that the library files (TBD or binary) in there should be considered private. resolves: rdar://137457006
2024-10-31[clang][lex] Remove `-index-header-map` (#114459)Jan Svoboda
This PR removes the `-index-header-map` functionality from Clang. AFAIK this was only used internally at Apple and is now dead code. The main motivation behind this change is to enable the removal of `HeaderFileInfo::Framework` member and reducing the size of that data structure. rdar://84036149
2024-01-02Revert "[clang][Darwin] Remove legacy framework search path logic in the ↵Arthur Eubanks
frontend (#75841)" This reverts commit 61999b18c407b9f5c07577e63057d41c65240e61. See comments on https://github.com/llvm/llvm-project/pull/75841. This was intended to be NFC but actually isn't.
2023-12-31[clang][Darwin] Remove legacy framework search path logic in the frontend ↵Louis Dionne
(#75841) This removes a long standing piece of technical debt. Most other platforms have moved all their header search path logic to the driver, but Darwin still had some logic for setting framework search paths present in the frontend. This patch moves that logic to the driver alongside existing logic that already handles part of these search paths. This is intended to be a pure refactor without any functional change visible to users, since the search paths before and after should be the same, and in the same order. The change in the tests is necessary because we would previously add the DriverKit framework search path in the frontend regardless of whether we actually need to, which we now handle correctly because the driver checks for ld64-605.1+. Fixes #75638
2023-12-13[clang] Use StringRef::{starts,ends}_with (NFC) (#75149)Kazu Hirata
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
2023-12-07Remove dead code; NFCAaron Ballman
This code was added 17 years ago but never enabled or tested. GCC warns that -I- is deprecated for them, and Clang gives an error when passed -I-, so we may as well remove this code rather than hook it up to the driver and maintain it.
2023-09-09[clang] NFCI: Use `FileEntryRef` in `CreateHeaderMap()`Jan Svoboda
2023-09-06[Lex] Remove unused AddGnuCPlusPlusIncludePaths after ↵Fangrui Song
e75f240a0432d827c28a5d77fad26a099ceb7a72
2023-08-29[Driver] move DragonFly header search path management to the driverBrad Smith
As has been done for other OS's. Move the header path management to the driver. Also I noticed with D89690 that the library paths were updated for GCC 8, but the C++ header path was not. So I also fixed that while here. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158376
2023-08-29[Driver] move ELFIAMCU / RTEMS header search path management to the driverBrad Smith
Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158132
2023-08-29Delete CloudABI supportBrad Smith
After this D108637 and with FreeBSD -current and now 14 dropping support for CloudABI I think it is time to consider deleting the CloudABI support. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158920
2023-08-28[Driver] Add LiteOS and z/OS to ShouldAddDefaultIncludePaths()Brad Smith
LiteOS (OHOS) and z/ZOS already have header path handling in the Driver, so add the OS's to ShouldAddDefaultIncludePaths(). Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D159042
2023-08-24[Driver] Add NaCl to ShouldAddDefaultIncludePaths()Brad Smith
The Driver for NaCl already handled the header paths so disable the default fallback path.
2023-08-24[Driver] Cleanup last vestiges of Minix / Contiki supportBrad Smith
Cleanup what is left after D158461. Reviewed by: MaskRay Differential Revision:
2023-08-15[Driver] move Haiku header search path management to the driverBrad Smith
Also while here sync the header paths with the Haiku GCC configuration. Added: /boot/system/develop/headers/gnu Removed: /boot/system/develop/headers/os/arch https://github.com/haikuports/haikuports/tree/master/sys-devel/gcc/patches Reviewed By: nielx Differential Revision: https://reviews.llvm.org/D157767
2023-05-31[clang] NFCI: Use `DirectoryEntryRef` for `ModuleMap::BuiltinIncludeDir`Jan Svoboda
This removes some uses of the deprecated `DirectoryEntry::getName()`.
2023-02-07[NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
2023-02-01[Driver] Move PS4/PS5 header search path management to the driverPaul Robinson
This follows how OpenBSD, FreeBSD, and NetBSD now work. (See D138183 and D140817 for those cases.) It also tidies up some code duplication that wasn't exactly right.
2023-01-14[clang] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-14[clang] Add #include <optional> (NFC)Kazu Hirata
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>. I'll post a separate patch to actually replace llvm::Optional with std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-05[Driver] move Fuchsia header search path management to the driverBrad Smith
Fuchsia already implements AddClangSystemIncludeArgs(). So it looks like we just have to switch over to using it. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D141073
2023-01-05[Driver] move NetBSD header search path management to the driverBrad Smith
This matches OpenBSD and FreeBSD. https://reviews.llvm.org/D138183 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D140817
2022-12-03[clang] Use std::nullopt instead of None (NFC)Kazu Hirata
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-18[Driver] move FreeBSD header search path management to the driverMatt Jacobson
This matches OpenBSD, and it supports Swift's use of clang for its C interop functionality. Recent changes to Swift use AddClangSystemIncludeArgs() to inspect the cc1 args; this doesn't work for platforms where cc1 adds standard include paths implicitly. See: <https://github.com/apple/swift/commit/cf3354222d9f480de74db390f53a6dcc749fde14> Also clean up InitHeaderSearch, making it clearer which targets manage header search paths in the driver. Differential Revision: https://reviews.llvm.org/D138183
2022-08-26[Clang][Driver] Refine/refactor DriverKit supportJulian Lettner
Add special Framework header search path for DriverKit.
2022-08-08[clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFCFangrui Song
With C++17 there is no Clang pedantic warning or MSVC C5051. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D131346
2022-04-14[PS5] Add basic PS5 driver behaviorPaul Robinson
This adds a PS5-specific ToolChain subclass, which defines some basic PS5 driver behavior. Future patches will add more target-specific driver behavior.
2022-04-05[PS4] Fix header search listPaul Robinson
A missing "break" in the initial implementation had us adding a spurious "/usr/include" to the header search list. Later someone introduced LLVM_FALLTHROUGH to prevent a warning. Replace this with the correct "break" and make sure the extra directory isn't added to the PS4 header search list.
2022-03-03[PS4] isPS4 and isPS4CPU are not meaningfully differentPaul Robinson
2022-01-11[clang] Move `ApplyHeaderSearchOptions` from Frontend to LexJan Svoboda
In D116750, the `clangFrontend` library was added as a dependency of `LexTests` in order to make `clang::ApplyHeaderSearchOptions()` available. This increased the number of TUs the test depends on. This patch moves the function into `clangLex` and removes dependency of `LexTests` on `clangFrontend`. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D117024