aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorIan Anderson <iana@apple.com>2025-05-08 12:30:51 -0700
committerGitHub <noreply@github.com>2025-05-08 12:30:51 -0700
commit515b4a4fdd7ac97373b68850a2ffa72e2b8e9178 (patch)
treecda061e416eb81b741a7d101c18636928a5ced07 /clang/lib/Frontend/CompilerInvocation.cpp
parentd7987f1ce9bdc57fe10de6eef25fbe0df725c68f (diff)
downloadllvm-515b4a4fdd7ac97373b68850a2ffa72e2b8e9178.zip
llvm-515b4a4fdd7ac97373b68850a2ffa72e2b8e9178.tar.gz
llvm-515b4a4fdd7ac97373b68850a2ffa72e2b8e9178.tar.bz2
[clang][Darwin] Remove legacy framework search path logic in the frontend (#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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index a0b8bbf..3945129 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3373,6 +3373,8 @@ static void GenerateHeaderSearchArgs(const HeaderSearchOptions &Opts,
: OPT_internal_externc_isystem;
GenerateArg(Consumer, Opt, It->Path);
}
+ for (; It < End && Matches(*It, {frontend::System}, true, true); ++It)
+ GenerateArg(Consumer, OPT_internal_iframework, It->Path);
assert(It == End && "Unhandled HeaderSearchOption::Entry.");
@@ -3505,6 +3507,8 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
Group = frontend::ExternCSystem;
Opts.AddPath(A->getValue(), Group, false, true);
}
+ for (const auto *A : Args.filtered(OPT_internal_iframework))
+ Opts.AddPath(A->getValue(), frontend::System, true, true);
// Add the path prefixes which are implicitly treated as being system headers.
for (const auto *A :