[PATCH] D130493: Disable stack-sizes section by default for PS4.

Ying Yi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 26 10:34:30 PDT 2022


MaggieYi updated this revision to Diff 447756.
MaggieYi added a comment.

Use `Args.addOptInFlag` instead of `Args.hasFlag`, thanks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130493/new/

https://reviews.llvm.org/D130493

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/stack-size-section.c


Index: clang/test/Driver/stack-size-section.c
===================================================================
--- clang/test/Driver/stack-size-section.c
+++ clang/test/Driver/stack-size-section.c
@@ -4,7 +4,7 @@
 // CHECK-ABSENT-NOT: -fstack-size-section
 
 // RUN: %clang -target x86_64-unknown -fstack-size-section -### 2>&1 | FileCheck %s --check-prefix=CHECK-PRESENT
-// RUN: %clang -target x86_64-scei-ps4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PRESENT
+// RUN: %clang -target x86_64-scei-ps4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ABSENT
 // CHECK-PRESENT: -fstack-size-section
 
 // RUN: %clang -target x86_64-unknown -fstack-size-section -fno-stack-size-section %s -### 2>&1 \
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5879,9 +5879,8 @@
     CmdArgs.push_back(A->getValue());
   }
 
-  if (Args.hasFlag(options::OPT_fstack_size_section,
-                   options::OPT_fno_stack_size_section, RawTriple.isPS4()))
-    CmdArgs.push_back("-fstack-size-section");
+  Args.addOptInFlag(CmdArgs, options::OPT_fstack_size_section,
+                    options::OPT_fno_stack_size_section);
 
   if (Args.hasArg(options::OPT_fstack_usage)) {
     CmdArgs.push_back("-stack-usage-file");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130493.447756.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220726/2c6bedb4/attachment.bin>


More information about the cfe-commits mailing list