Skip to content

[clang][Darwin] Minor args cleanup #139142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ian-twilightcoder
Copy link
Contributor

I just realized that ArgList.hasArg takes multiple arguments. Consolidate the two calls into one.

I just realized that ArgList.hasArg takes multiple arguments. Consolidate the two calls into one.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels May 8, 2025
@llvmbot
Copy link
Member

llvmbot commented May 8, 2025

@llvm/pr-subscribers-clang-driver

Author: Ian Anderson (ian-twilightcoder)

Changes

I just realized that ArgList.hasArg takes multiple arguments. Consolidate the two calls into one.


Full diff: https://github.com/llvm/llvm-project/pull/139142.diff

1 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Darwin.cpp (+1-2)
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 76fa2d121db2a..fe3952ee76229 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2582,8 +2582,7 @@ void DarwinClang::AddClangSystemIncludeArgs(
     llvm::opt::ArgStringList &CC1Args) const {
   AppleMachO::AddClangSystemIncludeArgs(DriverArgs, CC1Args);
 
-  if (DriverArgs.hasArg(options::OPT_nostdinc) ||
-      DriverArgs.hasArg(options::OPT_nostdlibinc))
+  if (DriverArgs.hasArg(options::OPT_nostdinc, options::OPT_nostdlibinc))
     return;
 
   llvm::SmallString<128> Sysroot = GetEffectiveSysroot(DriverArgs);

@llvmbot
Copy link
Member

llvmbot commented May 8, 2025

@llvm/pr-subscribers-clang

Author: Ian Anderson (ian-twilightcoder)

Changes

I just realized that ArgList.hasArg takes multiple arguments. Consolidate the two calls into one.


Full diff: https://github.com/llvm/llvm-project/pull/139142.diff

1 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Darwin.cpp (+1-2)
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 76fa2d121db2a..fe3952ee76229 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2582,8 +2582,7 @@ void DarwinClang::AddClangSystemIncludeArgs(
     llvm::opt::ArgStringList &CC1Args) const {
   AppleMachO::AddClangSystemIncludeArgs(DriverArgs, CC1Args);
 
-  if (DriverArgs.hasArg(options::OPT_nostdinc) ||
-      DriverArgs.hasArg(options::OPT_nostdlibinc))
+  if (DriverArgs.hasArg(options::OPT_nostdinc, options::OPT_nostdlibinc))
     return;
 
   llvm::SmallString<128> Sysroot = GetEffectiveSysroot(DriverArgs);

@ian-twilightcoder ian-twilightcoder merged commit 0d51247 into llvm:main May 9, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants