1
Fork 0

On ARM, use relocation_model to detect whether r9 should be reserved

The previous approach of checking for the reserve-r9 target feature
didn't actually work because LLVM only sets this feature very late when
initializing the per-function subtarget.
This commit is contained in:
Amanieu d'Antras 2022-02-17 14:16:52 +00:00
parent 2e8a7663b4
commit 1ceb104851
9 changed files with 67 additions and 47 deletions

View file

@ -66,6 +66,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
for (abi_name, abi_span) in &asm.clobber_abis {
match asm::InlineAsmClobberAbi::parse(
asm_arch,
self.sess.relocation_model(),
&self.sess.target_features,
&self.sess.target,
*abi_name,
@ -134,6 +135,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
asm::InlineAsmRegOrRegClass::Reg(if let Some(asm_arch) = asm_arch {
asm::InlineAsmReg::parse(
asm_arch,
sess.relocation_model(),
&sess.target_features,
&sess.target,
is_clobber,