[clang] 1e08544 - [PS4] Fix header search list
Paul Robinson via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 5 14:14:31 PDT 2022
Author: Paul Robinson
Date: 2022-04-05T14:14:13-07:00
New Revision: 1e085448b36db240c9068c8c4e4cb12d4d7093cb
URL: https://github.com/llvm/llvm-project/commit/1e085448b36db240c9068c8c4e4cb12d4d7093cb
DIFF: https://github.com/llvm/llvm-project/commit/1e085448b36db240c9068c8c4e4cb12d4d7093cb.diff
LOG: [PS4] Fix header search list
A missing "break" in the initial implementation had us adding a
spurious "/usr/include" to the header search list. Later someone
introduced LLVM_FALLTHROUGH to prevent a warning. Replace this with
the correct "break" and make sure the extra directory isn't added to
the PS4 header search list.
Added:
Modified:
clang/lib/Lex/InitHeaderSearch.cpp
clang/test/Driver/ps4-header-search.c
Removed:
################################################################################
diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp
index 2233c9fa114bc..86c6768d0d9fa 100644
--- a/clang/lib/Lex/InitHeaderSearch.cpp
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
@@ -372,7 +372,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
AddPath(BaseSDKPath + "/target/include", System, false);
if (triple.isPS4())
AddPath(BaseSDKPath + "/target/include_common", System, false);
- LLVM_FALLTHROUGH;
+ break;
}
default:
AddPath("/usr/include", ExternCSystem, false);
diff --git a/clang/test/Driver/ps4-header-search.c b/clang/test/Driver/ps4-header-search.c
index 3afef698d2642..20aaa5f97a749 100644
--- a/clang/test/Driver/ps4-header-search.c
+++ b/clang/test/Driver/ps4-header-search.c
@@ -3,8 +3,10 @@
// RUN: env SCE_ORBIS_SDK_DIR=%S/Inputs/scei-ps4_tree %clang -target x86_64-scei-ps4 -E -v %s 2>&1 | FileCheck %s --check-prefix=ENVPS4
// ENVPS4: Inputs/scei-ps4_tree/target/include{{$}}
// ENVPS4: Inputs/scei-ps4_tree/target/include_common{{$}}
+// ENVPS4-NOT: /usr/include
// RUN: %clang -isysroot %S/Inputs/scei-ps4_tree -target x86_64-scei-ps4 -E -v %s 2>&1 | FileCheck %s --check-prefix=SYSROOTPS4
// SYSROOTPS4: "{{[^"]*}}clang{{[^"]*}}"
// SYSROOTPS4: Inputs/scei-ps4_tree/target/include{{$}}
// SYSROOTPS4: Inputs/scei-ps4_tree/target/include_common{{$}}
+// SYSROOTPS4-NOT: /usr/include
More information about the cfe-commits
mailing list