1
Fork 0

Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa

Add clobber-only register classes for asm!

These are needed to properly express a function call ABI using a clobber
list, even though we don't support passing actual values into/out of
these registers.
This commit is contained in:
bors 2021-07-11 01:06:58 +00:00
commit 99f8efec46
11 changed files with 273 additions and 62 deletions

View file

@ -533,6 +533,12 @@ impl InlineAsmRegClass {
Self::Err => unreachable!("Use of InlineAsmRegClass::Err"),
}
}
/// Returns whether registers in this class can only be used as clobbers
/// and not as inputs/outputs.
pub fn is_clobber_only(self, arch: InlineAsmArch) -> bool {
self.supported_types(arch).is_empty()
}
}
#[derive(