dan sinclair | b4374c2 | 2020-07-25 03:34:33 +0000 | [diff] [blame] | 1 | // 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 Clayton | ed2b978 | 2020-12-01 18:04:17 +0000 | [diff] [blame] | 17 | #include "src/ast/module.h" |
Ben Clayton | 1e29f4b | 2021-01-21 16:20:40 +0000 | [diff] [blame] | 18 | #include "src/clone_context.h" |
Ben Clayton | ed2b978 | 2020-12-01 18:04:17 +0000 | [diff] [blame] | 19 | |
Ben Clayton | 89ea705 | 2020-12-02 18:19:28 +0000 | [diff] [blame] | 20 | TINT_INSTANTIATE_CLASS_ID(tint::ast::DiscardStatement); |
| 21 | |
dan sinclair | b4374c2 | 2020-07-25 03:34:33 +0000 | [diff] [blame] | 22 | namespace tint { |
| 23 | namespace ast { |
| 24 | |
Ben Clayton | e319d7f | 2020-11-30 23:30:58 +0000 | [diff] [blame] | 25 | DiscardStatement::DiscardStatement(const Source& source) : Base(source) {} |
| 26 | |
| 27 | DiscardStatement::DiscardStatement(DiscardStatement&&) = default; |
dan sinclair | b4374c2 | 2020-07-25 03:34:33 +0000 | [diff] [blame] | 28 | |
| 29 | DiscardStatement::~DiscardStatement() = default; |
| 30 | |
Ben Clayton | ed2b978 | 2020-12-01 18:04:17 +0000 | [diff] [blame] | 31 | DiscardStatement* DiscardStatement::Clone(CloneContext* ctx) const { |
Ben Clayton | 5c243f8 | 2021-01-22 13:41:06 +0000 | [diff] [blame^] | 32 | return ctx->dst->create<DiscardStatement>(ctx->Clone(source())); |
Ben Clayton | ed2b978 | 2020-12-01 18:04:17 +0000 | [diff] [blame] | 33 | } |
| 34 | |
dan sinclair | b4374c2 | 2020-07-25 03:34:33 +0000 | [diff] [blame] | 35 | bool DiscardStatement::IsValid() const { |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | void 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 |