inglorion updated this revision to Diff 89577. inglorion retitled this revision from "enable -flto=thin, -flto-jobs=, and -fthinlto-index= in clang-cl" to "enable -flto=thin in clang-cl". inglorion added a comment.
Implemented @hans's suggestion of moving the tests into cl-options.c. Also restricted the implementation to only implement -flto=. -flto-index= doesn't seem useful without further changes (it just complains that it requires -x ir, which is not supported by clang-cl). -flto-jobs would require a fair bit of extra work compared to what is here now, and I'm not sure it's worth it. The number of jobs lld-link uses can be controlled with /link:/opt:lldltojobs=N, anyway. We can implement support for this later if we want it - for now I really just want -flto=thin. https://reviews.llvm.org/D30239 Files: include/clang/Driver/Options.td test/Driver/cl-options.c Index: test/Driver/cl-options.c =================================================================== --- test/Driver/cl-options.c +++ test/Driver/cl-options.c @@ -522,6 +522,12 @@ // RUN: env CL="%s" _CL_="%s" not %clang --rsp-quoting=windows -c +// RUN: %clang_cl -### /c -flto %s 2>&1 | FileCheck -check-prefix=LTO %s +// LTO: -flto + +// RUN: %clang_cl -### /c -flto=thin %s 2>&1 | FileCheck -check-prefix=LTO-THIN %s +// LTO-THIN: -flto=thin + // Accept "core" clang options. // (/Zs is for syntax-only, -Werror makes it fail hard on unknown options) // RUN: %clang_cl \ Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -957,7 +957,7 @@ 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>; -def flto_EQ : Joined<["-"], "flto=">, Flags<[CC1Option]>, Group<f_Group>, +def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>, HelpText<"Set LTO mode to either 'full' or 'thin'">; def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>, HelpText<"Enable LTO in 'full' mode">;
Index: test/Driver/cl-options.c =================================================================== --- test/Driver/cl-options.c +++ test/Driver/cl-options.c @@ -522,6 +522,12 @@ // RUN: env CL="%s" _CL_="%s" not %clang --rsp-quoting=windows -c +// RUN: %clang_cl -### /c -flto %s 2>&1 | FileCheck -check-prefix=LTO %s +// LTO: -flto + +// RUN: %clang_cl -### /c -flto=thin %s 2>&1 | FileCheck -check-prefix=LTO-THIN %s +// LTO-THIN: -flto=thin + // Accept "core" clang options. // (/Zs is for syntax-only, -Werror makes it fail hard on unknown options) // RUN: %clang_cl \ Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -957,7 +957,7 @@ 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>; -def flto_EQ : Joined<["-"], "flto=">, Flags<[CC1Option]>, Group<f_Group>, +def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>, HelpText<"Set LTO mode to either 'full' or 'thin'">; def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>, HelpText<"Enable LTO in 'full' mode">;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits