@@ -1838,34 +1838,54 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
18381838 if (const Arg *arg = args.getLastArgNoClaim (OPT_call_graph_profile_sort))
18391839 error (firstArgStr + " is incompatible with " + arg->getSpelling ());
18401840 };
1841+ if (args.hasArg (OPT_irpgo_profile_sort) ||
1842+ args.hasArg (OPT_irpgo_profile_sort_eq))
1843+ log (" --irpgo-profile-sort is deprecated. Please use "
1844+ " --bp-startup-sort=function" );
1845+ if (const Arg *arg = args.getLastArg (OPT_irpgo_profile_eq)) {
1846+ config->irpgoProfilePath = arg->getValue ();
1847+ }
18411848 if (const Arg *arg = args.getLastArg (OPT_irpgo_profile_sort)) {
1842- config->irpgoProfileSortProfilePath = arg->getValue ();
1849+ config->irpgoProfilePath = arg->getValue ();
18431850 IncompatWithCGSort (arg->getSpelling ());
18441851 }
1845- config->compressionSortStartupFunctions =
1846- args.hasFlag (OPT_compression_sort_startup_functions,
1847- OPT_no_compression_sort_startup_functions, false );
1848- if (config->irpgoProfileSortProfilePath .empty () &&
1849- config->compressionSortStartupFunctions )
1850- error (" --compression-sort-startup-functions must be used with "
1851- " --irpgo-profile-sort" );
1852- if (const Arg *arg = args.getLastArg (OPT_compression_sort)) {
1852+ config->bpCompressionSortStartupFunctions =
1853+ args.hasFlag (OPT_bp_compression_sort_startup_functions,
1854+ OPT_no_bp_compression_sort_startup_functions, false );
1855+ if (config->irpgoProfilePath .empty () &&
1856+ config->bpCompressionSortStartupFunctions )
1857+ error (" --bp-compression-sort-startup-functions must be used with "
1858+ " --irpgo-profile" );
1859+ if (const Arg *arg = args.getLastArg (OPT_bp_startup_sort)) {
1860+ StringRef startupSortStr = arg->getValue ();
1861+ if (startupSortStr == " function" ) {
1862+ config->bpStartupFunctionSort = true ;
1863+ } else if (startupSortStr != " none" ) {
1864+ error (" unknown value `" + startupSortStr + " ` for " + arg->getSpelling ());
1865+ }
1866+ if (startupSortStr != " none" )
1867+ IncompatWithCGSort (arg->getSpelling ());
1868+ }
1869+ if (config->irpgoProfilePath .empty () && config->bpStartupFunctionSort )
1870+ error (" --bp-startup-sort=function must be used with "
1871+ " --irpgo-profile" );
1872+ if (const Arg *arg = args.getLastArg (OPT_bp_compression_sort)) {
18531873 StringRef compressionSortStr = arg->getValue ();
18541874 if (compressionSortStr == " function" ) {
1855- config->functionOrderForCompression = true ;
1875+ config->bpFunctionOrderForCompression = true ;
18561876 } else if (compressionSortStr == " data" ) {
1857- config->dataOrderForCompression = true ;
1877+ config->bpDataOrderForCompression = true ;
18581878 } else if (compressionSortStr == " both" ) {
1859- config->functionOrderForCompression = true ;
1860- config->dataOrderForCompression = true ;
1879+ config->bpFunctionOrderForCompression = true ;
1880+ config->bpDataOrderForCompression = true ;
18611881 } else if (compressionSortStr != " none" ) {
18621882 error (" unknown value `" + compressionSortStr + " ` for " +
18631883 arg->getSpelling ());
18641884 }
18651885 if (compressionSortStr != " none" )
18661886 IncompatWithCGSort (arg->getSpelling ());
18671887 }
1868- config->verboseBpSectionOrderer = args.hasArg (OPT_verbose_bp_section_orderer);
1888+ config->bpVerboseSectionOrderer = args.hasArg (OPT_verbose_bp_section_orderer);
18691889
18701890 for (const Arg *arg : args.filtered (OPT_alias)) {
18711891 config->aliasedSymbols .push_back (
0 commit comments