[clang] b375882 - [PS5] Correctly test for analyzer defaults
Paul Robinson via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 26 07:19:30 PDT 2022
Author: Paul Robinson
Date: 2022-04-26T07:14:48-07:00
New Revision: b375882014ccaa19c14bc7dc46a666a5a09bbb40
URL: https://github.com/llvm/llvm-project/commit/b375882014ccaa19c14bc7dc46a666a5a09bbb40
DIFF: https://github.com/llvm/llvm-project/commit/b375882014ccaa19c14bc7dc46a666a5a09bbb40.diff
LOG: [PS5] Correctly test for analyzer defaults
Commit 5c90eca added some analyzer option checking, but a typo meant
it was redundantly checking PS4 and not adding checking for PS5.
With the test corrected, it identified the necessary driver updates,
added in this commit.
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 0fd639da45ddf..6e4eadd3ab0e7 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3167,8 +3167,8 @@ static void RenderAnalyzerOptions(const ArgList &Args, ArgStringList &CmdArgs,
CmdArgs.push_back("-analyzer-checker=unix.cstring.NullArg");
}
- // Disable some unix checkers for PS4.
- if (Triple.isPS4()) {
+ // Disable some unix checkers for PS4/PS5.
+ if (Triple.isPS()) {
CmdArgs.push_back("-analyzer-disable-checker=unix.API");
CmdArgs.push_back("-analyzer-disable-checker=unix.Vfork");
}
@@ -3186,7 +3186,7 @@ static void RenderAnalyzerOptions(const ArgList &Args, ArgStringList &CmdArgs,
if (types::isCXX(Input.getType()))
CmdArgs.push_back("-analyzer-checker=cplusplus");
- if (!Triple.isPS4()) {
+ if (!Triple.isPS()) {
CmdArgs.push_back("-analyzer-checker=security.insecureAPI.UncheckedReturn");
CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw");
CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets");
diff --git a/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp b/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
index 6e76f2c90ac84..81a302c6bcbe3 100644
--- a/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
+++ b/clang/test/Driver/ps4-ps5-analyzer-defaults.cpp
@@ -17,13 +17,13 @@
// Negative check for unexpected checkers
// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-NEG-CHECKERS
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN: %clang -target x86_64-sie-ps5 --analyze %s -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-NEG-CHECKERS
//
// Check for all unix checkers except API and Vfork
// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-UNIX-CHECKERS
-// RUN: %clang -target x86_64-scei-ps4 --analyze %s -### 2>&1 \
+// RUN: %clang -target x86_64-sie-ps5 --analyze %s -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-UNIX-CHECKERS
// CHECK-POS-CHECKERS-DAG: analyzer-checker=core
More information about the cfe-commits
mailing list