Skip to content

Commit 28834f7

Browse files
committed
[clang][WebAssembly] Support the -m(no-)red-zone flag.
LLVM's WebAssembly backend supports the noredzone function attribute, but this support was not exposed in Clang.
1 parent 00b07aa commit 28834f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,6 +2404,9 @@ void Clang::AddWebAssemblyTargetArgs(const ArgList &Args,
24042404
if (!Args.hasArg(options::OPT_fvisibility_EQ,
24052405
options::OPT_fvisibility_ms_compat))
24062406
CmdArgs.push_back("-fvisibility=hidden");
2407+
2408+
if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true))
2409+
CmdArgs.push_back("-disable-red-zone");
24072410
}
24082411

24092412
void Clang::AddVETargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const {

0 commit comments

Comments
 (0)