[PATCH] D154388: Don't pass -ibuiltininc, which is used only by the driver, to CC1

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 3 13:49:52 PDT 2023


ahatanak created this revision.
ahatanak added reviewers: arphaman, fahad, MaskRay.
ahatanak added a project: clang.
Herald added a project: All.
ahatanak requested review of this revision.

This fixes a fallout from 5b77e752dcd073846b89559d6c0e1a7699e58615 <https://reviews.llvm.org/rG5b77e752dcd073846b89559d6c0e1a7699e58615>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154388

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


Index: clang/test/Driver/darwin-header-search-system.cpp
===================================================================
--- clang/test/Driver/darwin-header-search-system.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -1305,6 +1305,9 @@
     } 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 no need to pass to cc1.
+      continue;
     }
 
     // Not translated, render as usual.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154388.536884.patch
Type: text/x-patch
Size: 1300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230703/bd8547ca/attachment.bin>


More information about the cfe-commits mailing list