blob: 92a11f2b500129cb05acd3b949c195bd440362df [file] [log] [blame]
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/intrinsic-gen
// using the template:
// src/tint/resolver/intrinsic_table.inl.tmpl
// and the intrinsic defintion file:
// src/tint/intrinsics.def
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// clang-format off
/// TypeMatcher for 'type bool'
/// @see src/tint/intrinsics.def:73:6
class Bool : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Bool::Match(MatchState& state, const sem::Type* ty) const {
if (!match_bool(ty)) {
return nullptr;
}
return build_bool(state);
}
std::string Bool::String(MatchState*) const {
return "bool";
}
/// TypeMatcher for 'type af'
/// @see src/tint/intrinsics.def:74:48
class Af : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Af::Match(MatchState& state, const sem::Type* ty) const {
if (!match_af(ty)) {
return nullptr;
}
return build_af(state);
}
std::string Af::String(MatchState*) const {
std::stringstream ss;
ss << "abstract-float";
return ss.str();
}
/// TypeMatcher for 'type ai'
/// @see src/tint/intrinsics.def:75:48
class Ai : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Ai::Match(MatchState& state, const sem::Type* ty) const {
if (!match_ai(ty)) {
return nullptr;
}
return build_ai(state);
}
std::string Ai::String(MatchState*) const {
std::stringstream ss;
ss << "abstract-int";
return ss.str();
}
/// TypeMatcher for 'type i32'
/// @see src/tint/intrinsics.def:76:21
class I32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* I32::Match(MatchState& state, const sem::Type* ty) const {
if (!match_i32(ty)) {
return nullptr;
}
return build_i32(state);
}
std::string I32::String(MatchState*) const {
return "i32";
}
/// TypeMatcher for 'type u32'
/// @see src/tint/intrinsics.def:77:21
class U32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* U32::Match(MatchState& state, const sem::Type* ty) const {
if (!match_u32(ty)) {
return nullptr;
}
return build_u32(state);
}
std::string U32::String(MatchState*) const {
return "u32";
}
/// TypeMatcher for 'type f32'
/// @see src/tint/intrinsics.def:78:21
class F32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* F32::Match(MatchState& state, const sem::Type* ty) const {
if (!match_f32(ty)) {
return nullptr;
}
return build_f32(state);
}
std::string F32::String(MatchState*) const {
return "f32";
}
/// TypeMatcher for 'type vec2'
/// @see src/tint/intrinsics.def:79:6
class Vec2 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Vec2::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_vec2(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_vec2(state, T);
}
std::string Vec2::String(MatchState* state) const {
const std::string T = state->TypeName();
return "vec2<" + T + ">";
}
/// TypeMatcher for 'type vec3'
/// @see src/tint/intrinsics.def:80:6
class Vec3 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Vec3::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_vec3(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_vec3(state, T);
}
std::string Vec3::String(MatchState* state) const {
const std::string T = state->TypeName();
return "vec3<" + T + ">";
}
/// TypeMatcher for 'type vec4'
/// @see src/tint/intrinsics.def:81:6
class Vec4 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Vec4::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_vec4(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_vec4(state, T);
}
std::string Vec4::String(MatchState* state) const {
const std::string T = state->TypeName();
return "vec4<" + T + ">";
}
/// TypeMatcher for 'type mat2x2'
/// @see src/tint/intrinsics.def:82:6
class Mat2X2 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat2X2::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat2x2(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat2x2(state, T);
}
std::string Mat2X2::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat2x2<" + T + ">";
}
/// TypeMatcher for 'type mat2x3'
/// @see src/tint/intrinsics.def:83:6
class Mat2X3 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat2X3::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat2x3(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat2x3(state, T);
}
std::string Mat2X3::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat2x3<" + T + ">";
}
/// TypeMatcher for 'type mat2x4'
/// @see src/tint/intrinsics.def:84:6
class Mat2X4 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat2X4::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat2x4(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat2x4(state, T);
}
std::string Mat2X4::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat2x4<" + T + ">";
}
/// TypeMatcher for 'type mat3x2'
/// @see src/tint/intrinsics.def:85:6
class Mat3X2 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat3X2::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat3x2(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat3x2(state, T);
}
std::string Mat3X2::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat3x2<" + T + ">";
}
/// TypeMatcher for 'type mat3x3'
/// @see src/tint/intrinsics.def:86:6
class Mat3X3 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat3X3::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat3x3(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat3x3(state, T);
}
std::string Mat3X3::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat3x3<" + T + ">";
}
/// TypeMatcher for 'type mat3x4'
/// @see src/tint/intrinsics.def:87:6
class Mat3X4 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat3X4::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat3x4(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat3x4(state, T);
}
std::string Mat3X4::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat3x4<" + T + ">";
}
/// TypeMatcher for 'type mat4x2'
/// @see src/tint/intrinsics.def:88:6
class Mat4X2 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat4X2::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat4x2(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat4x2(state, T);
}
std::string Mat4X2::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat4x2<" + T + ">";
}
/// TypeMatcher for 'type mat4x3'
/// @see src/tint/intrinsics.def:89:6
class Mat4X3 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat4X3::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat4x3(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat4x3(state, T);
}
std::string Mat4X3::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat4x3<" + T + ">";
}
/// TypeMatcher for 'type mat4x4'
/// @see src/tint/intrinsics.def:90:6
class Mat4X4 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat4X4::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_mat4x4(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat4x4(state, T);
}
std::string Mat4X4::String(MatchState* state) const {
const std::string T = state->TypeName();
return "mat4x4<" + T + ">";
}
/// TypeMatcher for 'type vec'
/// @see src/tint/intrinsics.def:91:34
class Vec : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Vec::Match(MatchState& state, const sem::Type* ty) const {
Number N = Number::invalid;
const sem::Type* T = nullptr;
if (!match_vec(ty, N, T)) {
return nullptr;
}
N = state.Num(N);
if (!N.IsValid()) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_vec(state, N, T);
}
std::string Vec::String(MatchState* state) const {
const std::string N = state->NumName();
const std::string T = state->TypeName();
std::stringstream ss;
ss << "vec" << N << "<" << T << ">";
return ss.str();
}
/// TypeMatcher for 'type mat'
/// @see src/tint/intrinsics.def:92:34
class Mat : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Mat::Match(MatchState& state, const sem::Type* ty) const {
Number N = Number::invalid;
Number M = Number::invalid;
const sem::Type* T = nullptr;
if (!match_mat(ty, N, M, T)) {
return nullptr;
}
N = state.Num(N);
if (!N.IsValid()) {
return nullptr;
}
M = state.Num(M);
if (!M.IsValid()) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_mat(state, N, M, T);
}
std::string Mat::String(MatchState* state) const {
const std::string N = state->NumName();
const std::string M = state->NumName();
const std::string T = state->TypeName();
std::stringstream ss;
ss << "mat" << N << "x" << M << "<" << T << ">";
return ss.str();
}
/// TypeMatcher for 'type ptr'
/// @see src/tint/intrinsics.def:93:6
class Ptr : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Ptr::Match(MatchState& state, const sem::Type* ty) const {
Number S = Number::invalid;
const sem::Type* T = nullptr;
Number A = Number::invalid;
if (!match_ptr(ty, S, T, A)) {
return nullptr;
}
S = state.Num(S);
if (!S.IsValid()) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
A = state.Num(A);
if (!A.IsValid()) {
return nullptr;
}
return build_ptr(state, S, T, A);
}
std::string Ptr::String(MatchState* state) const {
const std::string S = state->NumName();
const std::string T = state->TypeName();
const std::string A = state->NumName();
return "ptr<" + S + ", " + T + ", " + A + ">";
}
/// TypeMatcher for 'type atomic'
/// @see src/tint/intrinsics.def:94:6
class Atomic : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Atomic::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_atomic(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_atomic(state, T);
}
std::string Atomic::String(MatchState* state) const {
const std::string T = state->TypeName();
return "atomic<" + T + ">";
}
/// TypeMatcher for 'type array'
/// @see src/tint/intrinsics.def:95:6
class Array : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Array::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_array(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_array(state, T);
}
std::string Array::String(MatchState* state) const {
const std::string T = state->TypeName();
return "array<" + T + ">";
}
/// TypeMatcher for 'type sampler'
/// @see src/tint/intrinsics.def:96:6
class Sampler : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Sampler::Match(MatchState& state, const sem::Type* ty) const {
if (!match_sampler(ty)) {
return nullptr;
}
return build_sampler(state);
}
std::string Sampler::String(MatchState*) const {
return "sampler";
}
/// TypeMatcher for 'type sampler_comparison'
/// @see src/tint/intrinsics.def:97:6
class SamplerComparison : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* SamplerComparison::Match(MatchState& state, const sem::Type* ty) const {
if (!match_sampler_comparison(ty)) {
return nullptr;
}
return build_sampler_comparison(state);
}
std::string SamplerComparison::String(MatchState*) const {
return "sampler_comparison";
}
/// TypeMatcher for 'type texture_1d'
/// @see src/tint/intrinsics.def:98:6
class Texture1D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Texture1D::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_1d(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_1d(state, T);
}
std::string Texture1D::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_1d<" + T + ">";
}
/// TypeMatcher for 'type texture_2d'
/// @see src/tint/intrinsics.def:99:6
class Texture2D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Texture2D::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_2d(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_2d(state, T);
}
std::string Texture2D::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_2d<" + T + ">";
}
/// TypeMatcher for 'type texture_2d_array'
/// @see src/tint/intrinsics.def:100:6
class Texture2DArray : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Texture2DArray::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_2d_array(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_2d_array(state, T);
}
std::string Texture2DArray::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_2d_array<" + T + ">";
}
/// TypeMatcher for 'type texture_3d'
/// @see src/tint/intrinsics.def:101:6
class Texture3D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Texture3D::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_3d(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_3d(state, T);
}
std::string Texture3D::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_3d<" + T + ">";
}
/// TypeMatcher for 'type texture_cube'
/// @see src/tint/intrinsics.def:102:6
class TextureCube : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureCube::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_cube(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_cube(state, T);
}
std::string TextureCube::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_cube<" + T + ">";
}
/// TypeMatcher for 'type texture_cube_array'
/// @see src/tint/intrinsics.def:103:6
class TextureCubeArray : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureCubeArray::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_cube_array(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_cube_array(state, T);
}
std::string TextureCubeArray::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_cube_array<" + T + ">";
}
/// TypeMatcher for 'type texture_multisampled_2d'
/// @see src/tint/intrinsics.def:104:6
class TextureMultisampled2D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureMultisampled2D::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_texture_multisampled_2d(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_texture_multisampled_2d(state, T);
}
std::string TextureMultisampled2D::String(MatchState* state) const {
const std::string T = state->TypeName();
return "texture_multisampled_2d<" + T + ">";
}
/// TypeMatcher for 'type texture_depth_2d'
/// @see src/tint/intrinsics.def:105:6
class TextureDepth2D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureDepth2D::Match(MatchState& state, const sem::Type* ty) const {
if (!match_texture_depth_2d(ty)) {
return nullptr;
}
return build_texture_depth_2d(state);
}
std::string TextureDepth2D::String(MatchState*) const {
return "texture_depth_2d";
}
/// TypeMatcher for 'type texture_depth_2d_array'
/// @see src/tint/intrinsics.def:106:6
class TextureDepth2DArray : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureDepth2DArray::Match(MatchState& state, const sem::Type* ty) const {
if (!match_texture_depth_2d_array(ty)) {
return nullptr;
}
return build_texture_depth_2d_array(state);
}
std::string TextureDepth2DArray::String(MatchState*) const {
return "texture_depth_2d_array";
}
/// TypeMatcher for 'type texture_depth_cube'
/// @see src/tint/intrinsics.def:107:6
class TextureDepthCube : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureDepthCube::Match(MatchState& state, const sem::Type* ty) const {
if (!match_texture_depth_cube(ty)) {
return nullptr;
}
return build_texture_depth_cube(state);
}
std::string TextureDepthCube::String(MatchState*) const {
return "texture_depth_cube";
}
/// TypeMatcher for 'type texture_depth_cube_array'
/// @see src/tint/intrinsics.def:108:6
class TextureDepthCubeArray : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureDepthCubeArray::Match(MatchState& state, const sem::Type* ty) const {
if (!match_texture_depth_cube_array(ty)) {
return nullptr;
}
return build_texture_depth_cube_array(state);
}
std::string TextureDepthCubeArray::String(MatchState*) const {
return "texture_depth_cube_array";
}
/// TypeMatcher for 'type texture_depth_multisampled_2d'
/// @see src/tint/intrinsics.def:109:6
class TextureDepthMultisampled2D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureDepthMultisampled2D::Match(MatchState& state, const sem::Type* ty) const {
if (!match_texture_depth_multisampled_2d(ty)) {
return nullptr;
}
return build_texture_depth_multisampled_2d(state);
}
std::string TextureDepthMultisampled2D::String(MatchState*) const {
return "texture_depth_multisampled_2d";
}
/// TypeMatcher for 'type texture_storage_1d'
/// @see src/tint/intrinsics.def:110:6
class TextureStorage1D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureStorage1D::Match(MatchState& state, const sem::Type* ty) const {
Number F = Number::invalid;
Number A = Number::invalid;
if (!match_texture_storage_1d(ty, F, A)) {
return nullptr;
}
F = state.Num(F);
if (!F.IsValid()) {
return nullptr;
}
A = state.Num(A);
if (!A.IsValid()) {
return nullptr;
}
return build_texture_storage_1d(state, F, A);
}
std::string TextureStorage1D::String(MatchState* state) const {
const std::string F = state->NumName();
const std::string A = state->NumName();
return "texture_storage_1d<" + F + ", " + A + ">";
}
/// TypeMatcher for 'type texture_storage_2d'
/// @see src/tint/intrinsics.def:111:6
class TextureStorage2D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureStorage2D::Match(MatchState& state, const sem::Type* ty) const {
Number F = Number::invalid;
Number A = Number::invalid;
if (!match_texture_storage_2d(ty, F, A)) {
return nullptr;
}
F = state.Num(F);
if (!F.IsValid()) {
return nullptr;
}
A = state.Num(A);
if (!A.IsValid()) {
return nullptr;
}
return build_texture_storage_2d(state, F, A);
}
std::string TextureStorage2D::String(MatchState* state) const {
const std::string F = state->NumName();
const std::string A = state->NumName();
return "texture_storage_2d<" + F + ", " + A + ">";
}
/// TypeMatcher for 'type texture_storage_2d_array'
/// @see src/tint/intrinsics.def:112:6
class TextureStorage2DArray : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureStorage2DArray::Match(MatchState& state, const sem::Type* ty) const {
Number F = Number::invalid;
Number A = Number::invalid;
if (!match_texture_storage_2d_array(ty, F, A)) {
return nullptr;
}
F = state.Num(F);
if (!F.IsValid()) {
return nullptr;
}
A = state.Num(A);
if (!A.IsValid()) {
return nullptr;
}
return build_texture_storage_2d_array(state, F, A);
}
std::string TextureStorage2DArray::String(MatchState* state) const {
const std::string F = state->NumName();
const std::string A = state->NumName();
return "texture_storage_2d_array<" + F + ", " + A + ">";
}
/// TypeMatcher for 'type texture_storage_3d'
/// @see src/tint/intrinsics.def:113:6
class TextureStorage3D : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureStorage3D::Match(MatchState& state, const sem::Type* ty) const {
Number F = Number::invalid;
Number A = Number::invalid;
if (!match_texture_storage_3d(ty, F, A)) {
return nullptr;
}
F = state.Num(F);
if (!F.IsValid()) {
return nullptr;
}
A = state.Num(A);
if (!A.IsValid()) {
return nullptr;
}
return build_texture_storage_3d(state, F, A);
}
std::string TextureStorage3D::String(MatchState* state) const {
const std::string F = state->NumName();
const std::string A = state->NumName();
return "texture_storage_3d<" + F + ", " + A + ">";
}
/// TypeMatcher for 'type texture_external'
/// @see src/tint/intrinsics.def:114:6
class TextureExternal : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* TextureExternal::Match(MatchState& state, const sem::Type* ty) const {
if (!match_texture_external(ty)) {
return nullptr;
}
return build_texture_external(state);
}
std::string TextureExternal::String(MatchState*) const {
return "texture_external";
}
/// TypeMatcher for 'type __modf_result'
/// @see src/tint/intrinsics.def:116:6
class ModfResult : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* ModfResult::Match(MatchState& state, const sem::Type* ty) const {
if (!match_modf_result(ty)) {
return nullptr;
}
return build_modf_result(state);
}
std::string ModfResult::String(MatchState*) const {
return "__modf_result";
}
/// TypeMatcher for 'type __modf_result_vec'
/// @see src/tint/intrinsics.def:117:39
class ModfResultVec : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* ModfResultVec::Match(MatchState& state, const sem::Type* ty) const {
Number N = Number::invalid;
if (!match_modf_result_vec(ty, N)) {
return nullptr;
}
N = state.Num(N);
if (!N.IsValid()) {
return nullptr;
}
return build_modf_result_vec(state, N);
}
std::string ModfResultVec::String(MatchState* state) const {
const std::string N = state->NumName();
std::stringstream ss;
ss << "__modf_result_vec" << N;
return ss.str();
}
/// TypeMatcher for 'type __frexp_result'
/// @see src/tint/intrinsics.def:118:6
class FrexpResult : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* FrexpResult::Match(MatchState& state, const sem::Type* ty) const {
if (!match_frexp_result(ty)) {
return nullptr;
}
return build_frexp_result(state);
}
std::string FrexpResult::String(MatchState*) const {
return "__frexp_result";
}
/// TypeMatcher for 'type __frexp_result_vec'
/// @see src/tint/intrinsics.def:119:40
class FrexpResultVec : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* FrexpResultVec::Match(MatchState& state, const sem::Type* ty) const {
Number N = Number::invalid;
if (!match_frexp_result_vec(ty, N)) {
return nullptr;
}
N = state.Num(N);
if (!N.IsValid()) {
return nullptr;
}
return build_frexp_result_vec(state, N);
}
std::string FrexpResultVec::String(MatchState* state) const {
const std::string N = state->NumName();
std::stringstream ss;
ss << "__frexp_result_vec" << N;
return ss.str();
}
/// TypeMatcher for 'type __atomic_compare_exchange_result'
/// @see src/tint/intrinsics.def:121:6
class AtomicCompareExchangeResult : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* AtomicCompareExchangeResult::Match(MatchState& state, const sem::Type* ty) const {
const sem::Type* T = nullptr;
if (!match_atomic_compare_exchange_result(ty, T)) {
return nullptr;
}
T = state.Type(T);
if (T == nullptr) {
return nullptr;
}
return build_atomic_compare_exchange_result(state, T);
}
std::string AtomicCompareExchangeResult::String(MatchState* state) const {
const std::string T = state->TypeName();
return "__atomic_compare_exchange_result<" + T + ">";
}
/// TypeMatcher for 'match fiu32'
/// @see src/tint/intrinsics.def:129:7
class Fiu32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Fiu32::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_u32(ty)) {
return build_u32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
return nullptr;
}
std::string Fiu32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << F32().String(nullptr) << ", " << I32().String(nullptr) << " or " << U32().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match fi32'
/// @see src/tint/intrinsics.def:130:7
class Fi32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Fi32::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
return nullptr;
}
std::string Fi32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << F32().String(nullptr) << " or " << I32().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match iu32'
/// @see src/tint/intrinsics.def:131:7
class Iu32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Iu32::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_u32(ty)) {
return build_u32(state);
}
return nullptr;
}
std::string Iu32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << I32().String(nullptr) << " or " << U32().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match scalar'
/// @see src/tint/intrinsics.def:132:7
class Scalar : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* Scalar::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_u32(ty)) {
return build_u32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
if (match_bool(ty)) {
return build_bool(state);
}
return nullptr;
}
std::string Scalar::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << F32().String(nullptr) << ", " << I32().String(nullptr) << ", " << U32().String(nullptr) << " or " << Bool().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match abstract_or_scalar'
/// @see src/tint/intrinsics.def:133:7
class AbstractOrScalar : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* AbstractOrScalar::Match(MatchState& state, const sem::Type* ty) const {
if (match_af(ty)) {
return build_af(state);
}
if (match_ai(ty)) {
return build_ai(state);
}
if (match_i32(ty)) {
return build_i32(state);
}
if (match_u32(ty)) {
return build_u32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
if (match_bool(ty)) {
return build_bool(state);
}
return nullptr;
}
std::string AbstractOrScalar::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << Ai().String(nullptr) << ", " << Af().String(nullptr) << ", " << F32().String(nullptr) << ", " << I32().String(nullptr) << ", " << U32().String(nullptr) << " or " << Bool().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match af_f32'
/// @see src/tint/intrinsics.def:134:7
class AfF32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* AfF32::Match(MatchState& state, const sem::Type* ty) const {
if (match_af(ty)) {
return build_af(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
return nullptr;
}
std::string AfF32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << Af().String(nullptr) << " or " << F32().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match scalar_no_f32'
/// @see src/tint/intrinsics.def:135:7
class ScalarNoF32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* ScalarNoF32::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_u32(ty)) {
return build_u32(state);
}
if (match_bool(ty)) {
return build_bool(state);
}
return nullptr;
}
std::string ScalarNoF32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << I32().String(nullptr) << ", " << U32().String(nullptr) << " or " << Bool().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match scalar_no_i32'
/// @see src/tint/intrinsics.def:136:7
class ScalarNoI32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* ScalarNoI32::Match(MatchState& state, const sem::Type* ty) const {
if (match_u32(ty)) {
return build_u32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
if (match_bool(ty)) {
return build_bool(state);
}
return nullptr;
}
std::string ScalarNoI32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << F32().String(nullptr) << ", " << U32().String(nullptr) << " or " << Bool().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match scalar_no_u32'
/// @see src/tint/intrinsics.def:137:7
class ScalarNoU32 : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* ScalarNoU32::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
if (match_bool(ty)) {
return build_bool(state);
}
return nullptr;
}
std::string ScalarNoU32::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << F32().String(nullptr) << ", " << I32().String(nullptr) << " or " << Bool().String(nullptr);
return ss.str();
}
/// TypeMatcher for 'match scalar_no_bool'
/// @see src/tint/intrinsics.def:138:7
class ScalarNoBool : public TypeMatcher {
public:
/// Checks whether the given type matches the matcher rules, and returns the
/// expected, canonicalized type on success.
/// Match may define and refine the template types and numbers in state.
/// @param state the MatchState
/// @param type the type to match
/// @returns the canonicalized type on match, otherwise nullptr
const sem::Type* Match(MatchState& state,
const sem::Type* type) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
const sem::Type* ScalarNoBool::Match(MatchState& state, const sem::Type* ty) const {
if (match_i32(ty)) {
return build_i32(state);
}
if (match_u32(ty)) {
return build_u32(state);
}
if (match_f32(ty)) {
return build_f32(state);
}
return nullptr;
}
std::string ScalarNoBool::String(MatchState*) const {
std::stringstream ss;
// Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
// template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
ss << F32().String(nullptr) << ", " << I32().String(nullptr) << " or " << U32().String(nullptr);
return ss.str();
}
/// EnumMatcher for 'match f32_texel_format'
/// @see src/tint/intrinsics.def:149:7
class F32TexelFormat : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number F32TexelFormat::Match(MatchState&, Number number) const {
switch (static_cast<TexelFormat>(number.Value())) {
case TexelFormat::kRgba8Unorm:
case TexelFormat::kRgba8Snorm:
case TexelFormat::kRgba16Float:
case TexelFormat::kR32Float:
case TexelFormat::kRg32Float:
case TexelFormat::kRgba32Float:
return number;
default:
return Number::invalid;
}
}
std::string F32TexelFormat::String(MatchState*) const {
return "rgba8unorm, rgba8snorm, rgba16float, r32float, rg32float or rgba32float";
}
/// EnumMatcher for 'match i32_texel_format'
/// @see src/tint/intrinsics.def:151:7
class I32TexelFormat : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number I32TexelFormat::Match(MatchState&, Number number) const {
switch (static_cast<TexelFormat>(number.Value())) {
case TexelFormat::kRgba8Sint:
case TexelFormat::kRgba16Sint:
case TexelFormat::kR32Sint:
case TexelFormat::kRg32Sint:
case TexelFormat::kRgba32Sint:
return number;
default:
return Number::invalid;
}
}
std::string I32TexelFormat::String(MatchState*) const {
return "rgba8sint, rgba16sint, r32sint, rg32sint or rgba32sint";
}
/// EnumMatcher for 'match u32_texel_format'
/// @see src/tint/intrinsics.def:153:7
class U32TexelFormat : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number U32TexelFormat::Match(MatchState&, Number number) const {
switch (static_cast<TexelFormat>(number.Value())) {
case TexelFormat::kRgba8Uint:
case TexelFormat::kRgba16Uint:
case TexelFormat::kR32Uint:
case TexelFormat::kRg32Uint:
case TexelFormat::kRgba32Uint:
return number;
default:
return Number::invalid;
}
}
std::string U32TexelFormat::String(MatchState*) const {
return "rgba8uint, rgba16uint, r32uint, rg32uint or rgba32uint";
}
/// EnumMatcher for 'match write_only'
/// @see src/tint/intrinsics.def:156:7
class WriteOnly : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number WriteOnly::Match(MatchState&, Number number) const {
if (number.IsAny() || number.Value() == static_cast<uint32_t>(Access::kWrite)) {
return Number(static_cast<uint32_t>(Access::kWrite));
}
return Number::invalid;
}
std::string WriteOnly::String(MatchState*) const {
return "write";
}
/// EnumMatcher for 'match function_private_workgroup'
/// @see src/tint/intrinsics.def:158:7
class FunctionPrivateWorkgroup : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number FunctionPrivateWorkgroup::Match(MatchState&, Number number) const {
switch (static_cast<StorageClass>(number.Value())) {
case StorageClass::kFunction:
case StorageClass::kPrivate:
case StorageClass::kWorkgroup:
return number;
default:
return Number::invalid;
}
}
std::string FunctionPrivateWorkgroup::String(MatchState*) const {
return "function, private or workgroup";
}
/// EnumMatcher for 'match workgroup_or_storage'
/// @see src/tint/intrinsics.def:159:7
class WorkgroupOrStorage : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number WorkgroupOrStorage::Match(MatchState&, Number number) const {
switch (static_cast<StorageClass>(number.Value())) {
case StorageClass::kWorkgroup:
case StorageClass::kStorage:
return number;
default:
return Number::invalid;
}
}
std::string WorkgroupOrStorage::String(MatchState*) const {
return "workgroup or storage";
}
/// EnumMatcher for 'match storage'
class Storage : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number Storage::Match(MatchState&, Number number) const {
if (number.IsAny() || number.Value() == static_cast<uint32_t>(StorageClass::kStorage)) {
return Number(static_cast<uint32_t>(StorageClass::kStorage));
}
return Number::invalid;
}
std::string Storage::String(MatchState*) const {
return "storage";
}
/// EnumMatcher for 'match write'
class Write : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number Write::Match(MatchState&, Number number) const {
if (number.IsAny() || number.Value() == static_cast<uint32_t>(Access::kWrite)) {
return Number(static_cast<uint32_t>(Access::kWrite));
}
return Number::invalid;
}
std::string Write::String(MatchState*) const {
return "write";
}
/// EnumMatcher for 'match read_write'
class ReadWrite : public NumberMatcher {
public:
/// Checks whether the given number matches the enum matcher rules.
/// Match may define template numbers in state.
/// @param state the MatchState
/// @param number the enum value as a Number
/// @return true if the enum value matches the set
Number Match(MatchState& state, Number number) const override;
/// @param state the MatchState
/// @return a string representation of the matcher.
std::string String(MatchState* state) const override;
};
Number ReadWrite::Match(MatchState&, Number number) const {
if (number.IsAny() || number.Value() == static_cast<uint32_t>(Access::kReadWrite)) {
return Number(static_cast<uint32_t>(Access::kReadWrite));
}
return Number::invalid;
}
std::string ReadWrite::String(MatchState*) const {
return "read_write";
}
/// Matchers holds type and number matchers
class Matchers {
private:
TemplateTypeMatcher template_type_0_{0};
TemplateTypeMatcher template_type_1_{1};
TemplateNumberMatcher template_number_0_{0};
TemplateNumberMatcher template_number_1_{1};
TemplateNumberMatcher template_number_2_{2};
Bool Bool_;
Af Af_;
Ai Ai_;
I32 I32_;
U32 U32_;
F32 F32_;
Vec2 Vec2_;
Vec3 Vec3_;
Vec4 Vec4_;
Mat2X2 Mat2X2_;
Mat2X3 Mat2X3_;
Mat2X4 Mat2X4_;
Mat3X2 Mat3X2_;
Mat3X3 Mat3X3_;
Mat3X4 Mat3X4_;
Mat4X2 Mat4X2_;
Mat4X3 Mat4X3_;
Mat4X4 Mat4X4_;
Vec Vec_;
Mat Mat_;
Ptr Ptr_;
Atomic Atomic_;
Array Array_;
Sampler Sampler_;
SamplerComparison SamplerComparison_;
Texture1D Texture1D_;
Texture2D Texture2D_;
Texture2DArray Texture2DArray_;
Texture3D Texture3D_;
TextureCube TextureCube_;
TextureCubeArray TextureCubeArray_;
TextureMultisampled2D TextureMultisampled2D_;
TextureDepth2D TextureDepth2D_;
TextureDepth2DArray TextureDepth2DArray_;
TextureDepthCube TextureDepthCube_;
TextureDepthCubeArray TextureDepthCubeArray_;
TextureDepthMultisampled2D TextureDepthMultisampled2D_;
TextureStorage1D TextureStorage1D_;
TextureStorage2D TextureStorage2D_;
TextureStorage2DArray TextureStorage2DArray_;
TextureStorage3D TextureStorage3D_;
TextureExternal TextureExternal_;
ModfResult ModfResult_;
ModfResultVec ModfResultVec_;
FrexpResult FrexpResult_;
FrexpResultVec FrexpResultVec_;
AtomicCompareExchangeResult AtomicCompareExchangeResult_;
Fiu32 Fiu32_;
Fi32 Fi32_;
Iu32 Iu32_;
Scalar Scalar_;
AbstractOrScalar AbstractOrScalar_;
AfF32 AfF32_;
ScalarNoF32 ScalarNoF32_;
ScalarNoI32 ScalarNoI32_;
ScalarNoU32 ScalarNoU32_;
ScalarNoBool ScalarNoBool_;
F32TexelFormat F32TexelFormat_;
I32TexelFormat I32TexelFormat_;
U32TexelFormat U32TexelFormat_;
WriteOnly WriteOnly_;
FunctionPrivateWorkgroup FunctionPrivateWorkgroup_;
WorkgroupOrStorage WorkgroupOrStorage_;
Storage Storage_;
Write Write_;
ReadWrite ReadWrite_;
public:
/// Constructor
Matchers();
/// Destructor
~Matchers();
/// The template types, types, and type matchers
TypeMatcher const* const type[59] = {
/* [0] */ &template_type_0_,
/* [1] */ &template_type_1_,
/* [2] */ &Bool_,
/* [3] */ &Af_,
/* [4] */ &Ai_,
/* [5] */ &I32_,
/* [6] */ &U32_,
/* [7] */ &F32_,
/* [8] */ &Vec2_,
/* [9] */ &Vec3_,
/* [10] */ &Vec4_,
/* [11] */ &Mat2X2_,
/* [12] */ &Mat2X3_,
/* [13] */ &Mat2X4_,
/* [14] */ &Mat3X2_,
/* [15] */ &Mat3X3_,
/* [16] */ &Mat3X4_,
/* [17] */ &Mat4X2_,
/* [18] */ &Mat4X3_,
/* [19] */ &Mat4X4_,
/* [20] */ &Vec_,
/* [21] */ &Mat_,
/* [22] */ &Ptr_,
/* [23] */ &Atomic_,
/* [24] */ &Array_,
/* [25] */ &Sampler_,
/* [26] */ &SamplerComparison_,
/* [27] */ &Texture1D_,
/* [28] */ &Texture2D_,
/* [29] */ &Texture2DArray_,
/* [30] */ &Texture3D_,
/* [31] */ &TextureCube_,
/* [32] */ &TextureCubeArray_,
/* [33] */ &TextureMultisampled2D_,
/* [34] */ &TextureDepth2D_,
/* [35] */ &TextureDepth2DArray_,
/* [36] */ &TextureDepthCube_,
/* [37] */ &TextureDepthCubeArray_,
/* [38] */ &TextureDepthMultisampled2D_,
/* [39] */ &TextureStorage1D_,
/* [40] */ &TextureStorage2D_,
/* [41] */ &TextureStorage2DArray_,
/* [42] */ &TextureStorage3D_,
/* [43] */ &TextureExternal_,
/* [44] */ &ModfResult_,
/* [45] */ &ModfResultVec_,
/* [46] */ &FrexpResult_,
/* [47] */ &FrexpResultVec_,
/* [48] */ &AtomicCompareExchangeResult_,
/* [49] */ &Fiu32_,
/* [50] */ &Fi32_,
/* [51] */ &Iu32_,
/* [52] */ &Scalar_,
/* [53] */ &AbstractOrScalar_,
/* [54] */ &AfF32_,
/* [55] */ &ScalarNoF32_,
/* [56] */ &ScalarNoI32_,
/* [57] */ &ScalarNoU32_,
/* [58] */ &ScalarNoBool_,
};
/// The template numbers, and number matchers
NumberMatcher const* const number[12] = {
/* [0] */ &template_number_0_,
/* [1] */ &template_number_1_,
/* [2] */ &template_number_2_,
/* [3] */ &F32TexelFormat_,
/* [4] */ &I32TexelFormat_,
/* [5] */ &U32TexelFormat_,
/* [6] */ &WriteOnly_,
/* [7] */ &FunctionPrivateWorkgroup_,
/* [8] */ &WorkgroupOrStorage_,
/* [9] */ &Storage_,
/* [10] */ &Write_,
/* [11] */ &ReadWrite_,
};
};
Matchers::Matchers() = default;
Matchers::~Matchers() = default;
constexpr MatcherIndex kMatcherIndices[] = {
/* [0] */ 22,
/* [1] */ 0,
/* [2] */ 23,
/* [3] */ 0,
/* [4] */ 11,
/* [5] */ 7,
/* [6] */ 22,
/* [7] */ 9,
/* [8] */ 24,
/* [9] */ 0,
/* [10] */ 0,
/* [11] */ 21,
/* [12] */ 0,
/* [13] */ 1,
/* [14] */ 7,
/* [15] */ 21,
/* [16] */ 0,
/* [17] */ 0,
/* [18] */ 7,
/* [19] */ 21,
/* [20] */ 0,
/* [21] */ 2,
/* [22] */ 7,
/* [23] */ 21,
/* [24] */ 1,
/* [25] */ 0,
/* [26] */ 7,
/* [27] */ 21,
/* [28] */ 1,
/* [29] */ 2,
/* [30] */ 7,
/* [31] */ 20,
/* [32] */ 0,
/* [33] */ 7,
/* [34] */ 41,
/* [35] */ 0,
/* [36] */ 1,
/* [37] */ 20,
/* [38] */ 0,
/* [39] */ 0,
/* [40] */ 42,
/* [41] */ 5,
/* [42] */ 10,
/* [43] */ 7,
/* [44] */ 20,
/* [45] */ 0,
/* [46] */ 2,
/* [47] */ 41,
/* [48] */ 5,
/* [49] */ 10,
/* [50] */ 0,
/* [51] */ 40,
/* [52] */ 5,
/* [53] */ 10,
/* [54] */ 1,
/* [55] */ 39,
/* [56] */ 5,
/* [57] */ 10,
/* [58] */ 5,
/* [59] */ 42,
/* [60] */ 4,
/* [61] */ 10,
/* [62] */ 6,
/* [63] */ 41,
/* [64] */ 4,
/* [65] */ 10,
/* [66] */ 2,
/* [67] */ 40,
/* [68] */ 4,
/* [69] */ 10,
/* [70] */ 39,
/* [71] */ 4,
/* [72] */ 10,
/* [73] */ 42,
/* [74] */ 3,
/* [75] */ 10,
/* [76] */ 20,
/* [77] */ 1,
/* [78] */ 7,
/* [79] */ 41,
/* [80] */ 3,
/* [81] */ 10,
/* [82] */ 40,
/* [83] */ 3,
/* [84] */ 10,
/* [85] */ 42,
/* [86] */ 0,
/* [87] */ 1,
/* [88] */ 40,
/* [89] */ 0,
/* [90] */ 1,
/* [91] */ 39,
/* [92] */ 0,
/* [93] */ 1,
/* [94] */ 20,
/* [95] */ 0,
/* [96] */ 5,
/* [97] */ 39,
/* [98] */ 3,
/* [99] */ 10,
/* [100] */ 20,
/* [101] */ 0,
/* [102] */ 6,
/* [103] */ 28,
/* [104] */ 7,
/* [105] */ 8,
/* [106] */ 0,
/* [107] */ 8,
/* [108] */ 1,
/* [109] */ 8,
/* [110] */ 7,
/* [111] */ 8,
/* [112] */ 5,
/* [113] */ 8,
/* [114] */ 6,
/* [115] */ 8,
/* [116] */ 2,
/* [117] */ 9,
/* [118] */ 0,
/* [119] */ 45,
/* [120] */ 0,
/* [121] */ 9,
/* [122] */ 1,
/* [123] */ 9,
/* [124] */ 7,
/* [125] */ 9,
/* [126] */ 5,
/* [127] */ 9,
/* [128] */ 6,
/* [129] */ 9,
/* [130] */ 2,
/* [131] */ 30,
/* [132] */ 0,
/* [133] */ 27,
/* [134] */ 0,
/* [135] */ 28,
/* [136] */ 0,
/* [137] */ 29,
/* [138] */ 0,
/* [139] */ 31,
/* [140] */ 0,
/* [141] */ 32,
/* [142] */ 0,
/* [143] */ 33,
/* [144] */ 0,
/* [145] */ 47,
/* [146] */ 0,
/* [147] */ 11,
/* [148] */ 0,
/* [149] */ 12,
/* [150] */ 7,
/* [151] */ 12,
/* [152] */ 0,
/* [153] */ 13,
/* [154] */ 7,
/* [155] */ 13,
/* [156] */ 0,
/* [157] */ 14,
/* [158] */ 7,
/* [159] */ 14,
/* [160] */ 0,
/* [161] */ 15,
/* [162] */ 7,
/* [163] */ 15,
/* [164] */ 0,
/* [165] */ 16,
/* [166] */ 7,
/* [167] */ 16,
/* [168] */ 0,
/* [169] */ 17,
/* [170] */ 7,
/* [171] */ 17,
/* [172] */ 0,
/* [173] */ 48,
/* [174] */ 0,
/* [175] */ 18,
/* [176] */ 7,
/* [177] */ 18,
/* [178] */ 0,
/* [179] */ 27,
/* [180] */ 7,
/* [181] */ 29,
/* [182] */ 7,
/* [183] */ 30,
/* [184] */ 7,
/* [185] */ 31,
/* [186] */ 7,
/* [187] */ 32,
/* [188] */ 7,
/* [189] */ 19,
/* [190] */ 7,
/* [191] */ 19,
/* [192] */ 0,
/* [193] */ 25,
/* [194] */ 26,
/* [195] */ 37,
/* [196] */ 36,
/* [197] */ 35,
/* [198] */ 34,
/* [199] */ 43,
/* [200] */ 38,
/* [201] */ 44,
/* [202] */ 46,
};
// Assert that the MatcherIndex is big enough to index all the matchers, plus
// kNoMatcher.
static_assert(static_cast<int>(sizeof(kMatcherIndices) / sizeof(kMatcherIndices[0])) <
static_cast<int>(std::numeric_limits<MatcherIndex>::max() - 1),
"MatcherIndex is not large enough to index kMatcherIndices");
constexpr ParameterInfo kParameters[] = {
{
/* [0] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [1] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [2] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [3] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [4] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [5] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [6] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [7] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [8] */
/* usage */ ParameterUsage::kNone,
/* matcher indices */ &kMatcherIndices[1],
},
{
/* [9] */
/* usage */ ParameterUsage::