Hi! I'd appreciate if we had the ability to turn off warnings about unknown
optimization flags without turning off warnings for other unknown flags.
Could you move these into a more specific warning flag under
Winvalid-command-line?


On 18 July 2014 04:39, Arthur Marble <[email protected]> wrote:

> Author: bubbles231
> Date: Fri Jul 18 06:38:58 2014
> New Revision: 213365
>
> URL: http://llvm.org/viewvc/llvm-project?rev=213365&view=rev
> Log:
> Moved 25 flags to clang_ignored_gcc_optimization_f_Group. Will display a
> warning
> to the user if they try to pass those optimizations. The revision for this
> patch
> is here: http://reviews.llvm.org/D4474. This patch will fix many errors
> in the
> rebuild of Debian with clang. Here is a link to the page for unknown
> arguments:
> http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG
>
> Modified:
>     cfe/trunk/include/clang/Driver/Options.td
>     cfe/trunk/test/Driver/clang_f_opts.c
>
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=213365&r1=213364&r2=213365&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Fri Jul 18 06:38:58 2014
> @@ -475,11 +475,11 @@ def fencoding_EQ : Joined<["-"], "fencod
>  def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>,
> Flags<[CoreOption]>;
>  def fexceptions : Flag<["-"], "fexceptions">, Group<f_Group>,
> Flags<[CC1Option]>,
>    HelpText<"Enable support for exception handling">;
> -def : Flag<["-"], "fexpensive-optimizations">,
> Group<clang_ignored_f_Group>;
> -def : Flag<["-"], "fno-expensive-optimizations">,
> Group<clang_ignored_f_Group>;
> +def : Flag<["-"], "fexpensive-optimizations">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +def : Flag<["-"], "fno-expensive-optimizations">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group<f_Group>;
> -def : Flag<["-"], "fdefer-pop">, Group<clang_ignored_f_Group>;
> -def : Flag<["-"], "fno-defer-pop">, Group<clang_ignored_f_Group>;
> +def : Flag<["-"], "fdefer-pop">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +def : Flag<["-"], "fno-defer-pop">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
>  def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>,
> Flags<[Unsupported]>;
>  def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
> @@ -568,12 +568,11 @@ def fgnu_runtime : Flag<["-"], "fgnu-run
>  def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">,
> Flags<[CC1Option]>;
>  def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>;
>  def : Flag<["-"], "findirect-virtual-calls">, Alias<fapple_kext>;
> -def finline_functions : Flag<["-"], "finline-functions">,
> Group<clang_ignored_f_Group>;
> +def finline_functions : Flag<["-"], "finline-functions">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
>  def finput_charset_EQ : Joined<["-"], "finput-charset=">, Group<f_Group>;
>  def finstrument_functions : Flag<["-"], "finstrument-functions">,
> Group<f_Group>, Flags<[CC1Option]>,
>    HelpText<"Generate calls to instrument function entry and exit">;
> -def : Flag<["-"], "fkeep-inline-functions">, Group<clang_ignored_f_Group>;
>  def flat__namespace : Flag<["-"], "flat_namespace">;
>  def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">,
> Group<f_Group>;
>  def flimited_precision_EQ : Joined<["-"], "flimited-precision=">,
> Group<f_Group>;
> @@ -695,7 +694,6 @@ def fno_exceptions : Flag<["-"], "fno-ex
>  def fno_gnu_keywords : Flag<["-"], "fno-gnu-keywords">, Group<f_Group>,
> Flags<[CC1Option]>;
>  def fno_inline_functions : Flag<["-"], "fno-inline-functions">,
> Group<f_clang_Group>, Flags<[CC1Option]>;
>  def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>,
> Flags<[CC1Option]>;
> -def : Flag<["-"], "fno-keep-inline-functions">,
> Group<clang_ignored_f_Group>;
>  def fno_lax_vector_conversions : Flag<["-"],
> "fno-lax-vector-conversions">, Group<f_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<f_Group>,
> @@ -814,7 +812,7 @@ def frtti : Flag<["-"], "frtti">, Group<
>  def : Flag<["-"], "fsched-interblock">, Group<clang_ignored_f_Group>;
>  def fshort_enums : Flag<["-"], "fshort-enums">, Group<f_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<clang_ignored_f_Group>;
> +def : Flag<["-"], "freorder-blocks">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  def fshort_wchar : Flag<["-"], "fshort-wchar">, Group<f_Group>,
> Flags<[CC1Option]>,
>    HelpText<"Force wchar_t to be a short unsigned int">;
>  def fno_short_wchar : Flag<["-"], "fno-short-wchar">, Group<f_Group>,
> Flags<[CC1Option]>,
> @@ -1588,53 +1586,55 @@ multiclass BooleanFFlag<string name> {
>    def _fno : Flag<["-"], "fno-"#name>;
>  }
>
> -def fprofile_dir : Joined<["-"], "fprofile-dir=">,
> Group<clang_ignored_f_Group>;
> +defm : BooleanFFlag<"no-keep-inline-functions">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>
> -defm profile_use : BooleanFFlag<"profile-use">,
> Group<clang_ignored_f_Group>;
> -def fprofile_use_EQ : Joined<["-"], "fprofile-use=">,
> Group<clang_ignored_f_Group>;
> +def fprofile_dir : Joined<["-"], "fprofile-dir=">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +
> +defm profile_use : BooleanFFlag<"profile-use">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +def fprofile_use_EQ : Joined<["-"], "fprofile-use=">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>;
>
> -defm align_functions : BooleanFFlag<"align-functions">,
> Group<clang_ignored_f_Group>;
> -def falign_functions_EQ : Joined<["-"], "falign-functions=">,
> Group<clang_ignored_f_Group>;
> +defm align_functions : BooleanFFlag<"align-functions">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +def falign_functions_EQ : Joined<["-"], "falign-functions=">,
> Group<clang_ignored_gcc_optimization_f_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<clang_ignored_f_Group>;
>
>  defm eliminate_unused_debug_types :
> BooleanFFlag<"eliminate-unused-debug-types">, Group<clang_ignored_f_Group>;
> -defm float_store : BooleanFFlag<"float-store">,
> Group<clang_ignored_f_Group>;
> +defm float_store : BooleanFFlag<"float-store">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm function_attribute_list : BooleanFFlag<"function-attribute-list">,
> Group<clang_ignored_f_Group>;
> -defm gcse : BooleanFFlag<"gcse">, Group<clang_ignored_f_Group>;
> +defm gcse : BooleanFFlag<"gcse">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm gnu : BooleanFFlag<"gnu">, Group<clang_ignored_f_Group>;
>  defm ident : BooleanFFlag<"ident">, Group<clang_ignored_f_Group>;
>  defm implicit_templates : BooleanFFlag<"implicit-templates">,
> Group<clang_ignored_f_Group>;
>  def finline_limit_EQ : Joined<["-"], "finline-limit=">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm finline_limit : BooleanFFlag<"inline-limit">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> -defm ivopts : BooleanFFlag<"ivopts">, Group<clang_ignored_f_Group>;
> +defm ivopts : BooleanFFlag<"ivopts">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">,
> Group<clang_ignored_f_Group>;
>  defm permissive : BooleanFFlag<"permissive">,
> Group<clang_ignored_f_Group>;
> -defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">,
> Group<clang_ignored_f_Group>;
> +defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm printf : BooleanFFlag<"printf">, Group<clang_ignored_f_Group>;
>  defm profile : BooleanFFlag<"profile">, Group<clang_ignored_f_Group>;
> -defm profile_correction : BooleanFFlag<"profile-correction">,
> Group<clang_ignored_f_Group>;
> +defm profile_correction : BooleanFFlag<"profile-correction">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm profile_generate_sampling :
> BooleanFFlag<"profile-generate-sampling">, Group<clang_ignored_f_Group>;
>  defm profile_reusedist : BooleanFFlag<"profile-reusedist">,
> Group<clang_ignored_f_Group>;
> -defm profile_values : BooleanFFlag<"profile-values">,
> Group<clang_ignored_f_Group>;
> +defm profile_values : BooleanFFlag<"profile-values">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm regs_graph : BooleanFFlag<"regs-graph">,
> Group<clang_ignored_f_Group>;
>  defm ripa : BooleanFFlag<"ripa">, Group<clang_ignored_f_Group>;
> -defm rounding_math : BooleanFFlag<"rounding-math">,
> Group<clang_ignored_f_Group>;
> -defm schedule_insns : BooleanFFlag<"schedule-insns">,
> Group<clang_ignored_f_Group>;
> +defm rounding_math : BooleanFFlag<"rounding-math">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +defm schedule_insns : BooleanFFlag<"schedule-insns">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm see : BooleanFFlag<"see">, Group<clang_ignored_f_Group>;
> -defm signaling_nans : BooleanFFlag<"signaling-nans">,
> Group<clang_ignored_f_Group>;
> +defm signaling_nans : BooleanFFlag<"signaling-nans">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm spec_constr_count : BooleanFFlag<"spec-constr-count">,
> Group<clang_ignored_f_Group>;
>  defm strength_reduce :
> -    BooleanFFlag<"strength-reduce">, Group<clang_ignored_f_Group>;
> +    BooleanFFlag<"strength-reduce">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm tls_model : BooleanFFlag<"tls-model">, Group<clang_ignored_f_Group>;
> -defm tracer : BooleanFFlag<"tracer">, Group<clang_ignored_f_Group>;
> +defm tracer : BooleanFFlag<"tracer">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>  defm tree_salias : BooleanFFlag<"tree-salias">,
> Group<clang_ignored_f_Group>;
>  defm tree_vectorizer_verbose : BooleanFFlag<"tree-vectorizer-verbose">,
> Group<clang_ignored_f_Group>;
> -defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">,
> Group<clang_ignored_f_Group>;
> -defm unswitch_loops : BooleanFFlag<"unswitch-loops">,
> Group<clang_ignored_f_Group>;
> +defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">,
> Group<clang_ignored_gcc_optimization_f_Group>;
> +defm unswitch_loops : BooleanFFlag<"unswitch-loops">,
> Group<clang_ignored_gcc_optimization_f_Group>;
>
>
>  // gfortran options that we recognize in the driver and pass along when
>
> Modified: cfe/trunk/test/Driver/clang_f_opts.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_f_opts.c?rev=213365&r1=213364&r2=213365&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Driver/clang_f_opts.c (original)
> +++ cfe/trunk/test/Driver/clang_f_opts.c Fri Jul 18 06:38:58 2014
> @@ -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              \
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to