1
Fork 0

compiler: compare and hash ExternAbi like its string

Directly map each ExternAbi variant to its string and back again.
This has a few advantages:
- By making the ABIs compare equal to their strings, we can easily
  lexicographically sort them and use that sorted slice at runtime.
- We no longer need a workaround to make sure the hashes remain stable,
  as they already naturally are (by being the hashes of unique strings).
- The compiler can carry around less &str wide pointers
This commit is contained in:
Jubilee Young 2025-02-10 03:57:32 -08:00
parent 038c183d5f
commit 8abff35b41
6 changed files with 144 additions and 25 deletions

View file

@ -747,8 +747,7 @@ fn print_crate_info(
}
}
CallingConventions => {
let mut calling_conventions = rustc_abi::all_names();
calling_conventions.sort_unstable();
let calling_conventions = rustc_abi::all_names();
println_info!("{}", calling_conventions.join("\n"));
}
RelocationModels