mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 04:56:07 +00:00

--order_file, call graph profile, and BalancedPartitioning currently build the section order vector by decreasing priority (from SIZE_MAX to 0). However, it's conventional to use an increasing key (see OutputSection::inputOrder). Switch to increasing priorities, remove the global variable highestAvailablePriority, and remove the highestAvailablePriority parameter from BPSectionOrderer. Change size_t to int. This improves consistenty with the ELF and COFF ports. The ELF port utilizes negative priorities for --symbol-ordering-file and call graph profile, and non-negative priorities for --shuffle-sections (no Mach-O counterpart yet). Pull Request: https://github.com/llvm/llvm-project/pull/121727