1 // Copyright 2021 The Tint Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include "src/ast/member_accessor_expression.h"
16 #include "src/sem/member_accessor_expression.h"
17
18 #include <utility>
19
20 TINT_INSTANTIATE_TYPEINFO(tint::sem::MemberAccessorExpression);
21 TINT_INSTANTIATE_TYPEINFO(tint::sem::StructMemberAccess);
22 TINT_INSTANTIATE_TYPEINFO(tint::sem::Swizzle);
23
24 namespace tint {
25 namespace sem {
26
MemberAccessorExpression(const ast::MemberAccessorExpression * declaration,const sem::Type * type,const Statement * statement)27 MemberAccessorExpression::MemberAccessorExpression(
28 const ast::MemberAccessorExpression* declaration,
29 const sem::Type* type,
30 const Statement* statement)
31 : Base(declaration, type, statement, Constant{}) {}
32
33 MemberAccessorExpression::~MemberAccessorExpression() = default;
34
StructMemberAccess(const ast::MemberAccessorExpression * declaration,const sem::Type * type,const Statement * statement,const StructMember * member)35 StructMemberAccess::StructMemberAccess(
36 const ast::MemberAccessorExpression* declaration,
37 const sem::Type* type,
38 const Statement* statement,
39 const StructMember* member)
40 : Base(declaration, type, statement), member_(member) {}
41
42 StructMemberAccess::~StructMemberAccess() = default;
43
Swizzle(const ast::MemberAccessorExpression * declaration,const sem::Type * type,const Statement * statement,std::vector<uint32_t> indices)44 Swizzle::Swizzle(const ast::MemberAccessorExpression* declaration,
45 const sem::Type* type,
46 const Statement* statement,
47 std::vector<uint32_t> indices)
48 : Base(declaration, type, statement), indices_(std::move(indices)) {}
49
50 Swizzle::~Swizzle() = default;
51
52 } // namespace sem
53 } // namespace tint
54