Skip to content

Commit 20b4f48

Browse files
committed
[Driver] Add -fno-split-stack
Summary: Add -fno-split-stack and rename CC1 option from `-split-stacks` to `-fsplit-stack`. Test Plan: check-all Differential Revision: https://reviews.llvm.org/D99245
1 parent 0d2c4db commit 20b4f48

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,7 +2377,10 @@ defm signed_char : BoolFOption<"signed-char",
23772377
LangOpts<"CharIsSigned">, DefaultTrue,
23782378
NegFlag<SetFalse, [CC1Option], "char is unsigned">, PosFlag<SetTrue, [], "char is signed">>,
23792379
ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
2380-
def fsplit_stack : Flag<["-"], "fsplit-stack">, Group<f_Group>;
2380+
defm split_stack : BoolFOption<"split-stack",
2381+
CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
2382+
NegFlag<SetFalse, [], "Wouldn't use segmented stack">,
2383+
PosFlag<SetTrue, [CC1Option], "Use segmented stack">>;
23812384
def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
23822385
HelpText<"Enable stack protectors for all functions">;
23832386
defm stack_clash_protection : BoolFOption<"stack-clash-protection",
@@ -4754,9 +4757,6 @@ def mtp : Separate<["-"], "mtp">,
47544757
def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
47554758
HelpText<"Limit float precision to the given value">,
47564759
MarshallingInfoString<CodeGenOpts<"LimitFloatPrecision">>;
4757-
def split_stacks : Flag<["-"], "split-stacks">,
4758-
HelpText<"Try to use a split stack if possible.">,
4759-
MarshallingInfoFlag<CodeGenOpts<"EnableSegmentedStacks">>;
47604760
def mregparm : Separate<["-"], "mregparm">,
47614761
HelpText<"Limit the number of registers available for integer arguments">,
47624762
MarshallingInfoInt<CodeGenOpts<"NumRegisterParameters">>;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4873,8 +4873,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
48734873
options::OPT_fno_experimental_relative_cxx_abi_vtables);
48744874

48754875
// Handle segmented stacks.
4876-
if (Args.hasArg(options::OPT_fsplit_stack))
4877-
CmdArgs.push_back("-split-stacks");
4876+
if (Args.hasFlag(options::OPT_fsplit_stack, options::OPT_fno_split_stack,
4877+
false))
4878+
CmdArgs.push_back("-fsplit-stack");
48784879

48794880
RenderFloatingPointOptions(TC, D, OFastEnabled, Args, CmdArgs, JA);
48804881

clang/test/Driver/clang_f_opts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fsplit-stack %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
44
// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-asm -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-enums %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
55

6-
// CHECK-OPTIONS1: -split-stacks
6+
// CHECK-OPTIONS1: -fsplit-stack
77
// CHECK-OPTIONS1: -fgnu-keywords
88
// CHECK-OPTIONS1: -fblocks
99
// CHECK-OPTIONS1: -fpascal-strings

0 commit comments

Comments
 (0)