summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2023-08-04 16:09:54 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2023-08-04 16:09:54 +0100
commita3ab31c0f957998cc16e1760e965c85a4923950b (patch)
treed5a0eb98fb67db04489b928e1519e063a3e7ad1e /compiler/rustc_codegen_llvm/src
parentda6b55cc5eaf76ed6acb7dc2f7d611e32af7c9a7 (diff)
downloadrust-a3ab31c0f957998cc16e1760e965c85a4923950b.tar.gz
rust-a3ab31c0f957998cc16e1760e965c85a4923950b.zip
Use `unstable_target_features` when checking inline assembly
This is necessary to properly validate register classes even when the
relevant target feature name is still unstable.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/asm.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs
index 2a6ad1be763..f5284395042 100644
--- a/compiler/rustc_codegen_llvm/src/asm.rs
+++ b/compiler/rustc_codegen_llvm/src/asm.rs
@@ -44,9 +44,10 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
                     let is_target_supported = |reg_class: InlineAsmRegClass| {
                         for &(_, feature) in reg_class.supported_types(asm_arch) {
                             if let Some(feature) = feature {
-                                let codegen_fn_attrs = self.tcx.codegen_fn_attrs(instance.def_id());
-                                if self.tcx.sess.target_features.contains(&feature)
-                                    || codegen_fn_attrs.target_features.contains(&feature)
+                                if self
+                                    .tcx
+                                    .asm_target_features(instance.def_id())
+                                    .contains(&feature)
                                 {
                                     return true;
                                 }