@@ -1838,34 +1838,54 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
1838
1838
if (const Arg *arg = args.getLastArgNoClaim (OPT_call_graph_profile_sort))
1839
1839
error (firstArgStr + " is incompatible with " + arg->getSpelling ());
1840
1840
};
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
+ }
1841
1848
if (const Arg *arg = args.getLastArg (OPT_irpgo_profile_sort)) {
1842
- config->irpgoProfileSortProfilePath = arg->getValue ();
1849
+ config->irpgoProfilePath = arg->getValue ();
1843
1850
IncompatWithCGSort (arg->getSpelling ());
1844
1851
}
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)) {
1853
1873
StringRef compressionSortStr = arg->getValue ();
1854
1874
if (compressionSortStr == " function" ) {
1855
- config->functionOrderForCompression = true ;
1875
+ config->bpFunctionOrderForCompression = true ;
1856
1876
} else if (compressionSortStr == " data" ) {
1857
- config->dataOrderForCompression = true ;
1877
+ config->bpDataOrderForCompression = true ;
1858
1878
} else if (compressionSortStr == " both" ) {
1859
- config->functionOrderForCompression = true ;
1860
- config->dataOrderForCompression = true ;
1879
+ config->bpFunctionOrderForCompression = true ;
1880
+ config->bpDataOrderForCompression = true ;
1861
1881
} else if (compressionSortStr != " none" ) {
1862
1882
error (" unknown value `" + compressionSortStr + " ` for " +
1863
1883
arg->getSpelling ());
1864
1884
}
1865
1885
if (compressionSortStr != " none" )
1866
1886
IncompatWithCGSort (arg->getSpelling ());
1867
1887
}
1868
- config->verboseBpSectionOrderer = args.hasArg (OPT_verbose_bp_section_orderer);
1888
+ config->bpVerboseSectionOrderer = args.hasArg (OPT_verbose_bp_section_orderer);
1869
1889
1870
1890
for (const Arg *arg : args.filtered (OPT_alias)) {
1871
1891
config->aliasedSymbols .push_back (
0 commit comments