diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index d3b61a51ca09..c03770095d82 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -943,7 +943,8 @@ def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group, Group, Flags<[CC1Option]>, HelpText<"Disable merging of globals">; def mno_mmx : Flag<["-"], "mno-mmx">, Group; -def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">, Group; +def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">, + Alias; def mno_red_zone : Flag<["-"], "mno-red-zone">, Group; def mno_relax_all : Flag<["-"], "mno-relax-all">, Group; def mno_rtd: Flag<["-"], "mno-rtd">, Group; @@ -982,7 +983,7 @@ def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Gr def momit_leaf_frame_pointer : Flag<["-"], "momit-leaf-frame-pointer">, Group, HelpText<"Omit frame pointer setup for leaf functions">, Flags<[CC1Option]>; def moslib_EQ : Joined<["-"], "moslib=">, Group; -def mpascal_strings : Flag<["-"], "mpascal-strings">, Group; +def mpascal_strings : Flag<["-"], "mpascal-strings">, Alias; def mred_zone : Flag<["-"], "mred-zone">, Group; def mregparm_EQ : Joined<["-"], "mregparm=">, Group; def mrelax_all : Flag<["-"], "mrelax-all">, Group, Flags<[CC1Option]>, diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 7eccbb55cd2a..50630b698903 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -3300,16 +3300,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Arg *A = Args.getLastArg(options::OPT_fshort_wchar)) A->render(Args, CmdArgs); - // -fno-pascal-strings is default, only pass non-default. If the tool chain - // happened to translate to -mpascal-strings, we want to back translate here. - // - // FIXME: This is gross; that translation should be pulled from the - // tool chain. + // -fno-pascal-strings is default, only pass non-default. if (Args.hasFlag(options::OPT_fpascal_strings, options::OPT_fno_pascal_strings, - false) || - Args.hasFlag(options::OPT_mpascal_strings, - options::OPT_mno_pascal_strings, false)) CmdArgs.push_back("-fpascal-strings"); diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index 5451945515a4..41d0b5e63db4 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -71,3 +71,9 @@ // CHECK-EXTENDED-IDENTIFIERS: "-cc1" // CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers" // CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers' + +// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s +// CHECK-M-PASCAL-STRINGS: "-fpascal-strings" + +// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s +// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"