1
Fork 0

asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by

the current target.
This commit is contained in:
Amanieu d'Antras 2021-12-07 23:46:38 +00:00
parent 0b42deaccc
commit 8716f2780e
5 changed files with 72 additions and 9 deletions

View file

@ -64,7 +64,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let mut clobber_abis = FxHashMap::default();
if let Some(asm_arch) = asm_arch {
for (abi_name, abi_span) in &asm.clobber_abis {
match asm::InlineAsmClobberAbi::parse(asm_arch, &self.sess.target, *abi_name) {
match asm::InlineAsmClobberAbi::parse(
asm_arch,
|feature| self.sess.target_features.contains(&Symbol::intern(feature)),
&self.sess.target,
*abi_name,
) {
Ok(abi) => {
// If the abi was already in the list, emit an error
match clobber_abis.get(&abi) {