Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -473,11 +473,11 @@ def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group, Flags<[CoreOption]>; def fexceptions : Flag<["-"], "fexceptions">, Group, Flags<[CC1Option]>, HelpText<"Enable support for exception handling">; -def : Flag<["-"], "fexpensive-optimizations">, Group; -def : Flag<["-"], "fno-expensive-optimizations">, Group; +def : Flag<["-"], "fexpensive-optimizations">, Group; +def : Flag<["-"], "fno-expensive-optimizations">, Group; def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group; -def : Flag<["-"], "fdefer-pop">, Group; -def : Flag<["-"], "fno-defer-pop">, Group; +def : Flag<["-"], "fdefer-pop">, Group; +def : Flag<["-"], "fno-defer-pop">, Group; def : Flag<["-"], "fextended-identifiers">, Group; def : Flag<["-"], "fno-extended-identifiers">, Group, Flags<[Unsupported]>; def fhosted : Flag<["-"], "fhosted">, Group; @@ -566,12 +566,11 @@ def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>; def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>; def : Flag<["-"], "findirect-virtual-calls">, Alias; -def finline_functions : Flag<["-"], "finline-functions">, Group; +def finline_functions : Flag<["-"], "finline-functions">, Group; def finline : Flag<["-"], "finline">, Group; def finput_charset_EQ : Joined<["-"], "finput-charset=">, Group; def finstrument_functions : Flag<["-"], "finstrument-functions">, Group, Flags<[CC1Option]>, HelpText<"Generate calls to instrument function entry and exit">; -def : Flag<["-"], "fkeep-inline-functions">, Group; def flat__namespace : Flag<["-"], "flat_namespace">; def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group; def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group; @@ -686,7 +685,6 @@ def fno_gnu_keywords : Flag<["-"], "fno-gnu-keywords">, Group, Flags<[CC1Option]>; def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group, Flags<[CC1Option]>; def fno_inline : Flag<["-"], "fno-inline">, Group, Flags<[CC1Option]>; -def : Flag<["-"], "fno-keep-inline-functions">, Group; def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group, HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">, Flags<[CC1Option]>; def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group, @@ -805,7 +803,7 @@ def : Flag<["-"], "fsched-interblock">, Group; def fshort_enums : Flag<["-"], "fshort-enums">, Group, Flags<[CC1Option]>, HelpText<"Allocate to an enum type only as many bytes as it needs for the declared range of possible values">; -def : Flag<["-"], "freorder-blocks">, Group; +def : Flag<["-"], "freorder-blocks">, Group; def fshort_wchar : Flag<["-"], "fshort-wchar">, Group, Flags<[CC1Option]>, HelpText<"Force wchar_t to be a short unsigned int">; def fno_short_wchar : Flag<["-"], "fno-short-wchar">, Group, Flags<[CC1Option]>, @@ -1576,53 +1574,55 @@ def _fno : Flag<["-"], "fno-"#name>; } -def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group; +defm : BooleanFFlag<"no-keep-inline-functions">, Group; -defm profile_use : BooleanFFlag<"profile-use">, Group; -def fprofile_use_EQ : Joined<["-"], "fprofile-use=">, Group; +def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group; + +defm profile_use : BooleanFFlag<"profile-use">, Group; +def fprofile_use_EQ : Joined<["-"], "fprofile-use=">, Group; def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group; -defm align_functions : BooleanFFlag<"align-functions">, Group; -def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group; +defm align_functions : BooleanFFlag<"align-functions">, Group; +def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group; // FIXME: This option should be supported and wired up to our diognostics, but // ignore it for now to avoid breaking builds that use it. def fdiagnostics_show_location_EQ : Joined<["-"], "fdiagnostics-show-location=">, Group; defm eliminate_unused_debug_types : BooleanFFlag<"eliminate-unused-debug-types">, Group; -defm float_store : BooleanFFlag<"float-store">, Group; +defm float_store : BooleanFFlag<"float-store">, Group; defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group; -defm gcse : BooleanFFlag<"gcse">, Group; +defm gcse : BooleanFFlag<"gcse">, Group; defm gnu : BooleanFFlag<"gnu">, Group; defm ident : BooleanFFlag<"ident">, Group; defm implicit_templates : BooleanFFlag<"implicit-templates">, Group; def finline_limit_EQ : Joined<["-"], "finline-limit=">, Group; defm finline_limit : BooleanFFlag<"inline-limit">, Group; -defm ivopts : BooleanFFlag<"ivopts">, Group; +defm ivopts : BooleanFFlag<"ivopts">, Group; defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group; defm permissive : BooleanFFlag<"permissive">, Group; -defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">, Group; +defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">, Group; defm printf : BooleanFFlag<"printf">, Group; defm profile : BooleanFFlag<"profile">, Group; -defm profile_correction : BooleanFFlag<"profile-correction">, Group; +defm profile_correction : BooleanFFlag<"profile-correction">, Group; defm profile_generate_sampling : BooleanFFlag<"profile-generate-sampling">, Group; defm profile_reusedist : BooleanFFlag<"profile-reusedist">, Group; -defm profile_values : BooleanFFlag<"profile-values">, Group; +defm profile_values : BooleanFFlag<"profile-values">, Group; defm regs_graph : BooleanFFlag<"regs-graph">, Group; defm ripa : BooleanFFlag<"ripa">, Group; -defm rounding_math : BooleanFFlag<"rounding-math">, Group; -defm schedule_insns : BooleanFFlag<"schedule-insns">, Group; +defm rounding_math : BooleanFFlag<"rounding-math">, Group; +defm schedule_insns : BooleanFFlag<"schedule-insns">, Group; defm see : BooleanFFlag<"see">, Group; -defm signaling_nans : BooleanFFlag<"signaling-nans">, Group; +defm signaling_nans : BooleanFFlag<"signaling-nans">, Group; defm spec_constr_count : BooleanFFlag<"spec-constr-count">, Group; defm strength_reduce : - BooleanFFlag<"strength-reduce">, Group; + BooleanFFlag<"strength-reduce">, Group; defm tls_model : BooleanFFlag<"tls-model">, Group; -defm tracer : BooleanFFlag<"tracer">, Group; +defm tracer : BooleanFFlag<"tracer">, Group; defm tree_salias : BooleanFFlag<"tree-salias">, Group; defm tree_vectorizer_verbose : BooleanFFlag<"tree-vectorizer-verbose">, Group; -defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">, Group; -defm unswitch_loops : BooleanFFlag<"unswitch-loops">, Group; +defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">, Group; +defm unswitch_loops : BooleanFFlag<"unswitch-loops">, Group; // gfortran options that we recognize in the driver and pass along when Index: test/Driver/clang_f_opts.c =================================================================== --- test/Driver/clang_f_opts.c +++ test/Driver/clang_f_opts.c @@ -170,10 +170,60 @@ // IGNORE-NOT: error: unknown argument // Test that the warning is displayed on these. -// RUN: %clang -### -finline-limit=1000 %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING1 %s -// RUN: %clang -### -finline-limit %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING2 %s -// CHECK-WARNING1: optimization flag '-finline-limit=1000' is not supported -// CHECK-WARNING2: optimization flag '-finline-limit' is not supported +// RUN: %clang -### \ +// RUN: -finline-limit=1000 \ +// RUN: -finline-limit \ +// RUN: -fexpensive-optimizations \ +// RUN: -fno-expensive-optimizations \ +// RUN: -fno-defer-pop \ +// RUN: -finline-functions \ +// RUN: -fno-keep-inline-functions \ +// RUN: -freorder-blocks \ +// RUN: -fprofile-dir=/rand/dir \ +// RUN: -fprofile-use \ +// RUN: -fprofile-use=/rand/dir \ +// RUN: -falign-functions \ +// RUN: -falign-functions=1 \ +// RUN: -ffloat-store \ +// RUN: -fgcse \ +// RUN: -fivopts \ +// RUN: -fprefetch-loop-arrays \ +// RUN: -fprofile-correction \ +// RUN: -fprofile-values \ +// RUN: -frounding-math \ +// RUN: -fschedule-insns \ +// RUN: -fsignaling-nans \ +// RUN: -fstrength-reduce \ +// RUN: -ftracer \ +// RUN: -funroll-all-loops \ +// RUN: -funswitch-loops \ +// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s +// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported +// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported +// CHECK-WARNING-DAG: optimization flag '-fexpensive-optimizations' is not supported +// CHECK-WARNING-DAG: optimization flag '-fno-expensive-optimizations' is not supported +// CHECK-WARNING-DAG: optimization flag '-fno-defer-pop' is not supported +// CHECK-WARNING-DAG: optimization flag '-finline-functions' is not supported +// CHECK-WARNING-DAG: optimization flag '-fno-keep-inline-functions' is not supported +// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported +// CHECK-WARNING-DAG: optimization flag '-fprofile-dir=/rand/dir' is not supported +// CHECK-WARNING-DAG: optimization flag '-fprofile-use' is not supported +// CHECK-WARNING-DAG: optimization flag '-fprofile-use=/rand/dir' is not supported +// CHECK-WARNING-DAG: optimization flag '-falign-functions' is not supported +// CHECK-WARNING-DAG: optimization flag '-falign-functions=1' is not supported +// CHECK-WARNING-DAG: optimization flag '-ffloat-store' is not supported +// CHECK-WARNING-DAG: optimization flag '-fgcse' is not supported +// CHECK-WARNING-DAG: optimization flag '-fivopts' is not supported +// CHECK-WARNING-DAG: optimization flag '-fprefetch-loop-arrays' is not supported +// CHECK-WARNING-DAG: optimization flag '-fprofile-correction' is not supported +// CHECK-WARNING-DAG: optimization flag '-fprofile-values' is not supported +// CHECK-WARNING-DAG: optimization flag '-frounding-math' is not supported +// CHECK-WARNING-DAG: optimization flag '-fschedule-insns' is not supported +// CHECK-WARNING-DAG: optimization flag '-fsignaling-nans' is not supported +// CHECK-WARNING-DAG: optimization flag '-fstrength-reduce' is not supported +// CHECK-WARNING-DAG: optimization flag '-ftracer' is not supported +// CHECK-WARNING-DAG: optimization flag '-funroll-all-loops' is not supported +// CHECK-WARNING-DAG: optimization flag '-funswitch-loops' is not supported // Test that we mute the warning on these // RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \