Index: ELF/Config.h =================================================================== --- ELF/Config.h +++ ELF/Config.h @@ -109,6 +109,7 @@ bool GdbIndex; bool GnuHash = false; bool ICF; + bool LTOUseNewPM; bool Mips64EL = false; bool MipsN32Abi = false; bool NoGnuUnique; Index: ELF/Driver.cpp =================================================================== --- ELF/Driver.cpp +++ ELF/Driver.cpp @@ -491,6 +491,7 @@ Config->GcSections = getArg(Args, OPT_gc_sections, OPT_no_gc_sections, false); Config->GdbIndex = Args.hasArg(OPT_gdb_index); Config->ICF = Args.hasArg(OPT_icf); + Config->LTOUseNewPM = Args.hasArg(OPT_lto_use_new_pm); Config->NoGnuUnique = Args.hasArg(OPT_no_gnu_unique); Config->NoUndefinedVersion = Args.hasArg(OPT_no_undefined_version); Config->Nostdlib = Args.hasArg(OPT_nostdlib); Index: ELF/LTO.cpp =================================================================== --- ELF/LTO.cpp +++ ELF/LTO.cpp @@ -76,6 +76,7 @@ Conf.DisableVerify = Config->DisableVerify; Conf.DiagHandler = diagnosticHandler; Conf.OptLevel = Config->LTOO; + Conf.OptUseNewPM = Config->LTOUseNewPM; // Set up a custom pipeline if we've been asked to. Conf.OptPipeline = Config->LTONewPmPasses; Index: ELF/Options.td =================================================================== --- ELF/Options.td +++ ELF/Options.td @@ -118,6 +118,9 @@ def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, HelpText<"Root name of library to use">; +def lto_use_new_pm: F<"lto-use-new-pm">, + HelpText<"Run the new pass manager as part of LTO">; + def lto_O: J<"lto-O">, MetaVarName<"">, HelpText<"Optimization level for LTO">;