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