blob: a8f0d3cd18aaf4b577cba6ba2f79a523885f009b [file] [log] [blame]
dan sinclairb4374c22020-07-25 03:34:33 +00001// Copyright 2020 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/discard_statement.h"
16
Ben Claytoned2b9782020-12-01 18:04:17 +000017#include "src/ast/module.h"
Ben Clayton1e29f4b2021-01-21 16:20:40 +000018#include "src/clone_context.h"
Ben Claytoned2b9782020-12-01 18:04:17 +000019
Ben Clayton89ea7052020-12-02 18:19:28 +000020TINT_INSTANTIATE_CLASS_ID(tint::ast::DiscardStatement);
21
dan sinclairb4374c22020-07-25 03:34:33 +000022namespace tint {
23namespace ast {
24
Ben Claytone319d7f2020-11-30 23:30:58 +000025DiscardStatement::DiscardStatement(const Source& source) : Base(source) {}
26
27DiscardStatement::DiscardStatement(DiscardStatement&&) = default;
dan sinclairb4374c22020-07-25 03:34:33 +000028
29DiscardStatement::~DiscardStatement() = default;
30
Ben Claytoned2b9782020-12-01 18:04:17 +000031DiscardStatement* DiscardStatement::Clone(CloneContext* ctx) const {
Ben Clayton5c243f82021-01-22 13:41:06 +000032 return ctx->dst->create<DiscardStatement>(ctx->Clone(source()));
Ben Claytoned2b9782020-12-01 18:04:17 +000033}
34
dan sinclairb4374c22020-07-25 03:34:33 +000035bool DiscardStatement::IsValid() const {
36 return true;
37}
38
39void DiscardStatement::to_str(std::ostream& out, size_t indent) const {
40 make_indent(out, indent);
41 out << "Discard{}" << std::endl;
42}
43
44} // namespace ast
45} // namespace tint