blob: 0215c08936dc9c24e0ec29402451919bb5eae75b [file] [log] [blame]
dan sinclaird37ecf92022-12-08 16:39:59 +00001// Copyright 2022 The Tint Authors.
Ryan Harrisondbc13af2022-02-21 15:19:07 +00002//
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
dan sinclaird37ecf92022-12-08 16:39:59 +000015#ifndef SRC_TINT_TYPE_VOID_H_
16#define SRC_TINT_TYPE_VOID_H_
Ryan Harrisondbc13af2022-02-21 15:19:07 +000017
18#include <string>
19
dan sinclair5f764d82022-12-08 00:32:27 +000020#include "src/tint/type/type.h"
Ryan Harrisondbc13af2022-02-21 15:19:07 +000021
dan sinclaird37ecf92022-12-08 16:39:59 +000022namespace tint::type {
Ryan Harrisondbc13af2022-02-21 15:19:07 +000023
24/// A void type
dan sinclair12fa3032023-04-19 23:52:33 +000025class Void final : public utils::Castable<Void, Type> {
dan sinclair41e4d9a2022-05-01 14:40:55 +000026 public:
27 /// Constructor
28 Void();
Ryan Harrisondbc13af2022-02-21 15:19:07 +000029
Ben Claytonce93a6b2022-12-19 17:07:29 +000030 /// Destructor
31 ~Void() override;
Ben Clayton43919752022-03-07 17:05:28 +000032
Ben Clayton7c3e9a62022-12-16 15:31:19 +000033 /// @param other the other node to compare against
34 /// @returns true if the this type is equal to @p other
35 bool Equals(const UniqueNode& other) const override;
Ben Clayton43919752022-03-07 17:05:28 +000036
dan sinclair41e4d9a2022-05-01 14:40:55 +000037 /// @returns the name for this type that closely resembles how it would be
38 /// declared in WGSL.
dan sinclaird026e132023-04-18 19:38:25 +000039 std::string FriendlyName() const override;
dan sinclairf8abdc72023-01-05 21:07:15 +000040
41 /// @param ctx the clone context
42 /// @returns a clone of this type
43 Void* Clone(CloneContext& ctx) const override;
Ryan Harrisondbc13af2022-02-21 15:19:07 +000044};
45
dan sinclaird37ecf92022-12-08 16:39:59 +000046} // namespace tint::type
Ryan Harrisondbc13af2022-02-21 15:19:07 +000047
dan sinclaird37ecf92022-12-08 16:39:59 +000048#endif // SRC_TINT_TYPE_VOID_H_