[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #120149)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 13:36:14 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff b21fa18b44dd73284bd1c6551b8046c94f84f9f3 e578bd75d82a5ff16168222e4f30c32f9aa5e6bd --extensions cpp,c -- clang/test/Driver/darwin-framework-search-paths.c clang/lib/Driver/Job.cpp clang/lib/Driver/ToolChains/Darwin.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Lex/InitHeaderSearch.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp
index 07d2d371c5..8bdc53732e 100644
--- a/clang/lib/Driver/Job.cpp
+++ b/clang/lib/Driver/Job.cpp
@@ -67,14 +67,15 @@ static bool skipArgs(const char *Flag, bool HaveCrashVFS, int &SkipNum,
     return true;
 
   // Some include flags shouldn't be skipped if we have a crash VFS
-  IsInclude = llvm::StringSwitch<bool>(Flag)
-    .Cases("-include", "-header-include-file", true)
-    .Cases("-idirafter", "-internal-isystem", "-iwithprefix", true)
-    .Cases("-internal-externc-isystem", "-iprefix", true)
-    .Cases("-iwithprefixbefore", "-isystem", "-iquote", true)
-    .Cases("-isysroot", "-I", "-F", "-resource-dir", true)
-    .Cases("-internal-iframework", "-iframework", "-include-pch", true)
-    .Default(false);
+  IsInclude =
+      llvm::StringSwitch<bool>(Flag)
+          .Cases("-include", "-header-include-file", true)
+          .Cases("-idirafter", "-internal-isystem", "-iwithprefix", true)
+          .Cases("-internal-externc-isystem", "-iprefix", true)
+          .Cases("-iwithprefixbefore", "-isystem", "-iquote", true)
+          .Cases("-isysroot", "-I", "-F", "-resource-dir", true)
+          .Cases("-internal-iframework", "-iframework", "-include-pch", true)
+          .Default(false);
   if (IsInclude)
     return !HaveCrashVFS;
 
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 76d6244daf..735ddc3d65 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2552,7 +2552,7 @@ void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs
   }
 
   // Add default framework search paths
-  auto addFrameworkInclude = [&](auto ...Path) {
+  auto addFrameworkInclude = [&](auto... Path) {
     SmallString<128> P(Sysroot);
     llvm::sys::path::append(P, Path...);
 
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 4713fea5a2..728163b0ca 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3413,7 +3413,8 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
 
   // Add the internal paths from a driver that detects standard include paths.
   for (const auto *A :
-       Args.filtered(OPT_internal_isystem, OPT_internal_externc_isystem, OPT_internal_iframework)) {
+       Args.filtered(OPT_internal_isystem, OPT_internal_externc_isystem,
+                     OPT_internal_iframework)) {
     frontend::IncludeDirGroup Group = frontend::System;
     bool IsFramework = false;
     if (A->getOption().matches(OPT_internal_externc_isystem))

``````````

</details>


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


More information about the cfe-commits mailing list