LLVM: lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTypeUtilities.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
17
18using namespace llvm;
19
26 .Cases({"v128", "i8x16", "i16x8", "i32x4", "i64x2", "f32x4", "f64x2"},
32}
33
48
49
50
52 switch (Type) {
54 return "i32";
56 return "i64";
58 return "f32";
60 return "f64";
62 return "v128";
64 return "funcref";
66 return "externref";
68 return "exnref";
70 return "func";
72 return "void";
73 default:
74 return "invalid_type";
75 }
76}
77
81
83 std::string S;
84 for (const auto &Type : List) {
86 S += ", ";
88 }
89 return S;
90}
91
93 std::string S("(");
95 S += ") -> (";
97 S += ")";
98 return S;
99}
100
102 switch (RC) {
103 case WebAssembly::I32RegClassID:
105 case WebAssembly::I64RegClassID:
107 case WebAssembly::F32RegClassID:
109 case WebAssembly::F64RegClassID:
111 case WebAssembly::V128RegClassID:
113 case WebAssembly::FUNCREFRegClassID:
115 case WebAssembly::EXTERNREFRegClassID:
117 case WebAssembly::EXNREFRegClassID:
119 default:
121 }
122}
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This file provides WebAssembly-specific target descriptions.
This file contains the declaration of the WebAssembly-specific type parsing utility functions.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
The instances of the Type class are immutable: once they are created, they are never changed.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const char * typeToString(wasm::ValType Type)
Definition WebAssemblyMCTypeUtilities.cpp:78
BlockType parseBlockType(StringRef Type)
Definition WebAssemblyMCTypeUtilities.cpp:34
wasm::ValType regClassToValType(unsigned RC)
Definition WebAssemblyMCTypeUtilities.cpp:101
BlockType
Used as immediate MachineOperands for block signatures.
std::string signatureToString(const wasm::WasmSignature *Sig)
Definition WebAssemblyMCTypeUtilities.cpp:92
const char * anyTypeToString(unsigned Type)
Definition WebAssemblyMCTypeUtilities.cpp:51
std::string typeListToString(ArrayRef< wasm::ValType > List)
Definition WebAssemblyMCTypeUtilities.cpp:82
std::optional< wasm::ValType > parseType(StringRef Type)
Definition WebAssemblyMCTypeUtilities.cpp:20
This is an optimization pass for GlobalISel generic memory operations.
SmallVector< ValType, 1 > Returns
SmallVector< ValType, 4 > Params