[clang] a2b7297 - Don't pass -ibuiltininc, which is used only by the driver, to CC1

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 14:03:29 PDT 2023


Author: Akira Hatanaka
Date: 2023-07-05T14:03:21-07:00
New Revision: a2b7297dff345e3fc4886c7e76a67d32ea2cd134

URL: https://github.com/llvm/llvm-project/commit/a2b7297dff345e3fc4886c7e76a67d32ea2cd134
DIFF: https://github.com/llvm/llvm-project/commit/a2b7297dff345e3fc4886c7e76a67d32ea2cd134.diff

LOG: Don't pass -ibuiltininc, which is used only by the driver, to CC1

This fixes a fallout from 5b77e752dcd073846b89559d6c0e1a7699e58615.

Differential Revision: https://reviews.llvm.org/D154388

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/test/Driver/darwin-header-search-system.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index f85584b3335e4b..0321da8e43f636 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1305,6 +1305,9 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
     } else if (A->getOption().matches(options::OPT_stdlibxx_isystem)) {
       // Translated to -internal-isystem by the driver, no need to pass to cc1.
       continue;
+    } else if (A->getOption().matches(options::OPT_ibuiltininc)) {
+      // This is used only by the driver. No need to pass to cc1.
+      continue;
     }
 
     // Not translated, render as usual.

diff  --git a/clang/test/Driver/darwin-header-search-system.cpp b/clang/test/Driver/darwin-header-search-system.cpp
index 590535fae354de..5fb83b62ce7e63 100644
--- a/clang/test/Driver/darwin-header-search-system.cpp
+++ b/clang/test/Driver/darwin-header-search-system.cpp
@@ -131,6 +131,7 @@
 // RUN:               -DRESOURCE=%S/Inputs/resource_dir \
 // RUN:               --check-prefix=CHECK-NOSTDINC-BUILTINC %s
 // CHECK-NOSTDINC-BUILTINC: "-cc1"
+// CHECK-NOSTDINC-BUILTINC-NOT: "-ibuiltininc"
 // CHECK-NOSTDINC-BUILTINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
 // CHECK-NOSTDINC-BUILTINC: "-internal-isystem" "[[RESOURCE]]/include"
 // CHECK-NOSTDINC-BUILTINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"


        


More information about the cfe-commits mailing list