Skip to content

Commit b6d1df2

Browse files
authored
[PowerPC] Support -mno-red-zone option (#94581)
1 parent de5deb7 commit b6d1df2

File tree

3 files changed

+525
-0
lines changed

3 files changed

+525
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,9 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
21042104
CmdArgs.push_back("-mabi=vec-extabi");
21052105
}
21062106

2107+
if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true))
2108+
CmdArgs.push_back("-disable-red-zone");
2109+
21072110
ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args);
21082111
if (FloatABI == ppc::FloatABI::Soft) {
21092112
// Floating point operations and argument passing are soft.

clang/test/Driver/flags.c

+3
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@
3333
//
3434
// RUN: %clang --target=riscv64 -### -S -mno-implicit-float %s 2>&1 | FileCheck -check-prefix=TEST11 %s
3535
// TEST11: "-no-implicit-float"
36+
//
37+
// RUN: %clang --target=ppc64le -### -S -mno-red-zone %s 2>&1 | FileCheck -check-prefix=TEST12 %s
38+
// TEST12: "-disable-red-zone"

0 commit comments

Comments
 (0)