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
This commit is contained in:
Akira Hatanaka 2023-07-05 14:02:59 -07:00
parent 198df5f682
commit a2b7297dff
2 changed files with 4 additions and 0 deletions

View File

@ -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.

View File

@ -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"