[clang] 1628486 - ignore -flto= options recognized by GCC

Sylvestre Ledru via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 5 02:54:52 PDT 2021


Author: Sylvestre Ledru
Date: 2021-04-05T11:54:17+02:00
New Revision: 1628486548420f85b3467026d54663d1516404f5

URL: https://github.com/llvm/llvm-project/commit/1628486548420f85b3467026d54663d1516404f5
DIFF: https://github.com/llvm/llvm-project/commit/1628486548420f85b3467026d54663d1516404f5.diff

LOG: ignore -flto= options recognized by GCC

as requested in https://bugs.llvm.org/show_bug.cgi?id=49553, submitting the proposed changes to just ignore the -flto= options which are recognized by GCC ("auto" and "jobserver").

GCC supports -flto=<auto|jobserver|<N> to select the parallelity for LTO builds. LLVM also has -flto-jobs=<N>, which only seems to have a meaning when used with -flto=thin?

The attached patch just ignores the values "auto" and "jobserver". that doesn't change anything in functionality.  Another option would be to map these values to either "thin" or "full", maybe in presence of the -ffat-lto-objects option?

-flto=<n> could also be translated to -flto-jobs=<N>.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D99501

Added: 
    

Modified: 
    clang/include/clang/Driver/Options.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index a6583acd9ecb..64d658b2bfd9 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4155,6 +4155,8 @@ defm reorder_blocks : BooleanFFlag<"reorder-blocks">, Group<clang_ignored_gcc_op
 defm branch_count_reg : BooleanFFlag<"branch-count-reg">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm default_inline : BooleanFFlag<"default-inline">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm fat_lto_objects : BooleanFFlag<"fat-lto-objects">, Group<clang_ignored_gcc_optimization_f_Group>;
+def : Flag<["-"], "flto=auto">, Group<clang_ignored_gcc_optimization_f_Group>;
+def : Flag<["-"], "flto=jobserver">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm float_store : BooleanFFlag<"float-store">, Group<clang_ignored_gcc_optimization_f_Group>;
 defm friend_injection : BooleanFFlag<"friend-injection">, Group<clang_ignored_f_Group>;
 defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group<clang_ignored_f_Group>;


        


More information about the cfe-commits mailing list