Skip to content

Commit

Permalink
[PowerPC] Support -mno-red-zone option (llvm#94581)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnelises authored Aug 19, 2024
1 parent de5deb7 commit b6d1df2
Show file tree
Hide file tree
Showing 3 changed files with 525 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,9 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
CmdArgs.push_back("-mabi=vec-extabi");
}

if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true))
CmdArgs.push_back("-disable-red-zone");

ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args);
if (FloatABI == ppc::FloatABI::Soft) {
// Floating point operations and argument passing are soft.
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Driver/flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
//
// RUN: %clang --target=riscv64 -### -S -mno-implicit-float %s 2>&1 | FileCheck -check-prefix=TEST11 %s
// TEST11: "-no-implicit-float"
//
// RUN: %clang --target=ppc64le -### -S -mno-red-zone %s 2>&1 | FileCheck -check-prefix=TEST12 %s
// TEST12: "-disable-red-zone"
Loading

0 comments on commit b6d1df2

Please sign in to comment.