blob: 566fcebc43c596a0143c1c1ba33950f5c517925b [file] [log] [blame]
Ben Clayton17374852021-04-30 19:58:49 +00001// 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
Ben Clayton8758f102021-06-09 14:32:14 +000015#include "src/ast/type_decl.h"
Ben Clayton17374852021-04-30 19:58:49 +000016
17#include "src/program_builder.h"
18
Ben Clayton8758f102021-06-09 14:32:14 +000019TINT_INSTANTIATE_TYPEINFO(tint::ast::TypeDecl);
Ben Clayton17374852021-04-30 19:58:49 +000020
21namespace tint {
22namespace ast {
23
Ben Clayton8758f102021-06-09 14:32:14 +000024TypeDecl::TypeDecl(ProgramID program_id, const Source& source, Symbol name)
Ben Clayton17374852021-04-30 19:58:49 +000025 : Base(program_id, source), name_(name) {
Ben Claytonffd28e22021-06-24 11:27:36 +000026 TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(AST, name, program_id);
Ben Clayton17374852021-04-30 19:58:49 +000027}
28
Ben Clayton8758f102021-06-09 14:32:14 +000029TypeDecl::TypeDecl(TypeDecl&&) = default;
Ben Clayton17374852021-04-30 19:58:49 +000030
Ben Clayton8758f102021-06-09 14:32:14 +000031TypeDecl::~TypeDecl() = default;
Ben Clayton17374852021-04-30 19:58:49 +000032
Ben Clayton8758f102021-06-09 14:32:14 +000033void TypeDecl::to_str(const sem::Info&,
34 std::ostream& out,
35 size_t indent) const {
36 make_indent(out, indent);
37 out << type_name();
Ben Clayton17374852021-04-30 19:58:49 +000038}
39
40} // namespace ast
41} // namespace tint