]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/asm/wasm.rs
Auto merge of #80339 - jyn514:no-span, r=GuillaumeGomez
[rust.git] / compiler / rustc_target / src / asm / wasm.rs
1 use super::{InlineAsmArch, InlineAsmType};
2 use rustc_macros::HashStable_Generic;
3
4 def_reg_class! {
5     Wasm WasmInlineAsmRegClass {
6         local,
7     }
8 }
9
10 impl WasmInlineAsmRegClass {
11     pub fn valid_modifiers(self, _arch: super::InlineAsmArch) -> &'static [char] {
12         &[]
13     }
14
15     pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> {
16         None
17     }
18
19     pub fn suggest_modifier(
20         self,
21         _arch: InlineAsmArch,
22         _ty: InlineAsmType,
23     ) -> Option<(char, &'static str)> {
24         None
25     }
26
27     pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<(char, &'static str)> {
28         None
29     }
30
31     pub fn supported_types(
32         self,
33         _arch: InlineAsmArch,
34     ) -> &'static [(InlineAsmType, Option<&'static str>)] {
35         match self {
36             Self::local => {
37                 types! { _: I8, I16, I32, I64, F32, F64; }
38             }
39         }
40     }
41 }
42
43 def_regs! {
44     // WebAssembly doesn't have registers.
45     Wasm WasmInlineAsmReg WasmInlineAsmRegClass {}
46 }