Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -1938,7 +1938,7 @@ def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group, HelpText<"Force linking the clang builtins runtime library">; def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option]>, Group, - HelpText<"Set LTO mode to either 'full' or 'thin'">, Values<"thin,full">; + HelpText<"Set LTO mode to either 'full' or 'thin'">, Values<"thin,full,auto,jobserver">; def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group, HelpText<"Enable LTO in 'full' mode">; def fno_lto : Flag<["-"], "fno-lto">, Flags<[CoreOption, CC1Option]>, Group, @@ -4226,8 +4226,6 @@ defm branch_count_reg : BooleanFFlag<"branch-count-reg">, Group; defm default_inline : BooleanFFlag<"default-inline">, Group; defm fat_lto_objects : BooleanFFlag<"fat-lto-objects">, Group; -def : Flag<["-"], "flto=auto">, Group; -def : Flag<["-"], "flto=jobserver">, Group; defm float_store : BooleanFFlag<"float-store">, Group; defm friend_injection : BooleanFFlag<"friend-injection">, Group; defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group; Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ clang/lib/Driver/Driver.cpp @@ -609,6 +609,8 @@ LTOMode = llvm::StringSwitch(LTOName) .Case("full", LTOK_Full) + .Case("auto", LTOK_Full) // GCC compatibility + .Case("jobserver", LTOK_Full) // GCC compatibility .Case("thin", LTOK_Thin) .Default(LTOK_Unknown); Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -1707,8 +1707,7 @@ StringRef S = A->getValue(); if (S == "thin") Opts.PrepareForThinLTO = true; - else if (S != "full") - Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << S; + // -flto=full and invalid values are handled elsewhere. } if (Arg *A = Args.getLastArg(OPT_fthinlto_index_EQ)) { if (IK.getLanguage() != Language::LLVM_IR) Index: clang/test/Driver/autocomplete.c =================================================================== --- clang/test/Driver/autocomplete.c +++ clang/test/Driver/autocomplete.c @@ -72,7 +72,9 @@ // FFPALL-NEXT: off // FFPALL-NEXT: on // RUN: %clang --autocomplete=-flto= | FileCheck %s -check-prefix=FLTOALL +// FLTOALL: auto // FLTOALL: full +// FLTOALL: jobserver // FLTOALL-NEXT: thin // RUN: %clang --autocomplete=-fveclib= | FileCheck %s -check-prefix=FVECLIBALL // FVECLIBALL: Accelerate