Author: Ying Yi
Date: 2022-07-27T09:37:20+01:00
New Revision: bfe191dfa79bbccb57506055db9c89bfb891f65c

URL: 
https://github.com/llvm/llvm-project/commit/bfe191dfa79bbccb57506055db9c89bfb891f65c
DIFF: 
https://github.com/llvm/llvm-project/commit/bfe191dfa79bbccb57506055db9c89bfb891f65c.diff

LOG: Disable stack-sizes section by default for PS4.

Differential Revision: https://reviews.llvm.org/D130493

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index b62a025c5072..d3ff71ee28e9 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5886,9 +5886,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
     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");

diff  --git a/clang/test/Driver/stack-size-section.c 
b/clang/test/Driver/stack-size-section.c
index f50c9767e707..b99b1409bef4 100644
--- a/clang/test/Driver/stack-size-section.c
+++ b/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 \


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to