[clang] 20b4f48 - [Driver] Add -fno-split-stack
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 24 23:19:08 PDT 2021
Author: Chuanqi Xu
Date: 2021-03-25T14:18:28+08:00
New Revision: 20b4f484d16faa73123fa81ac332d283ada6771e
URL: https://github.com/llvm/llvm-project/commit/20b4f484d16faa73123fa81ac332d283ada6771e
DIFF: https://github.com/llvm/llvm-project/commit/20b4f484d16faa73123fa81ac332d283ada6771e.diff
LOG: [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
Added:
Modified:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/clang_f_opts.c
Removed:
################################################################################
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index e0881dc608f31..a48b922e884a6 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2377,7 +2377,10 @@ defm signed_char : BoolFOption<"signed-char",
LangOpts<"CharIsSigned">, DefaultTrue,
NegFlag<SetFalse, [CC1Option], "char is unsigned">, PosFlag<SetTrue, [], "char is signed">>,
ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
-def fsplit_stack : Flag<["-"], "fsplit-stack">, Group<f_Group>;
+defm split_stack : BoolFOption<"split-stack",
+ CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
+ NegFlag<SetFalse, [], "Wouldn't use segmented stack">,
+ PosFlag<SetTrue, [CC1Option], "Use segmented stack">>;
def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
HelpText<"Enable stack protectors for all functions">;
defm stack_clash_protection : BoolFOption<"stack-clash-protection",
@@ -4754,9 +4757,6 @@ def mtp : Separate<["-"], "mtp">,
def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
HelpText<"Limit float precision to the given value">,
MarshallingInfoString<CodeGenOpts<"LimitFloatPrecision">>;
-def split_stacks : Flag<["-"], "split-stacks">,
- HelpText<"Try to use a split stack if possible.">,
- MarshallingInfoFlag<CodeGenOpts<"EnableSegmentedStacks">>;
def mregparm : Separate<["-"], "mregparm">,
HelpText<"Limit the number of registers available for integer arguments">,
MarshallingInfoInt<CodeGenOpts<"NumRegisterParameters">>;
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index a64dc4e80dec8..f8cc23198e67a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4873,8 +4873,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_experimental_relative_cxx_abi_vtables);
// Handle segmented stacks.
- if (Args.hasArg(options::OPT_fsplit_stack))
- CmdArgs.push_back("-split-stacks");
+ if (Args.hasFlag(options::OPT_fsplit_stack, options::OPT_fno_split_stack,
+ false))
+ CmdArgs.push_back("-fsplit-stack");
RenderFloatingPointOptions(TC, D, OFastEnabled, Args, CmdArgs, JA);
diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c
index b383579f10793..12369361f8115 100644
--- a/clang/test/Driver/clang_f_opts.c
+++ b/clang/test/Driver/clang_f_opts.c
@@ -3,7 +3,7 @@
// 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
// 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
-// CHECK-OPTIONS1: -split-stacks
+// CHECK-OPTIONS1: -fsplit-stack
// CHECK-OPTIONS1: -fgnu-keywords
// CHECK-OPTIONS1: -fblocks
// CHECK-OPTIONS1: -fpascal-strings
More information about the cfe-commits
mailing list