1cb93a386Sopenharmony_ci// Copyright 2020 The Tint Authors. 2cb93a386Sopenharmony_ci// 3cb93a386Sopenharmony_ci// Licensed under the Apache License, Version 2.0 (the "License"); 4cb93a386Sopenharmony_ci// you may not use this file except in compliance with the License. 5cb93a386Sopenharmony_ci// You may obtain a copy of the License at 6cb93a386Sopenharmony_ci// 7cb93a386Sopenharmony_ci// http://www.apache.org/licenses/LICENSE-2.0 8cb93a386Sopenharmony_ci// 9cb93a386Sopenharmony_ci// Unless required by applicable law or agreed to in writing, software 10cb93a386Sopenharmony_ci// distributed under the License is distributed on an "AS IS" BASIS, 11cb93a386Sopenharmony_ci// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12cb93a386Sopenharmony_ci// See the License for the specific language governing permissions and 13cb93a386Sopenharmony_ci// limitations under the License. 14cb93a386Sopenharmony_ci 15cb93a386Sopenharmony_ci#ifndef SRC_AST_F32_H_ 16cb93a386Sopenharmony_ci#define SRC_AST_F32_H_ 17cb93a386Sopenharmony_ci 18cb93a386Sopenharmony_ci#include <string> 19cb93a386Sopenharmony_ci 20cb93a386Sopenharmony_ci#include "src/ast/type.h" 21cb93a386Sopenharmony_ci 22cb93a386Sopenharmony_cinamespace tint { 23cb93a386Sopenharmony_cinamespace ast { 24cb93a386Sopenharmony_ci 25cb93a386Sopenharmony_ci/// A float 32 type 26cb93a386Sopenharmony_ciclass F32 : public Castable<F32, Type> { 27cb93a386Sopenharmony_ci public: 28cb93a386Sopenharmony_ci /// Constructor 29cb93a386Sopenharmony_ci /// @param pid the identifier of the program that owns this node 30cb93a386Sopenharmony_ci /// @param src the source of this node 31cb93a386Sopenharmony_ci F32(ProgramID pid, const Source& src); 32cb93a386Sopenharmony_ci /// Move constructor 33cb93a386Sopenharmony_ci F32(F32&&); 34cb93a386Sopenharmony_ci ~F32() override; 35cb93a386Sopenharmony_ci 36cb93a386Sopenharmony_ci /// @param symbols the program's symbol table 37cb93a386Sopenharmony_ci /// @returns the name for this type that closely resembles how it would be 38cb93a386Sopenharmony_ci /// declared in WGSL. 39cb93a386Sopenharmony_ci std::string FriendlyName(const SymbolTable& symbols) const override; 40cb93a386Sopenharmony_ci 41cb93a386Sopenharmony_ci /// Clones this type and all transitive types using the `CloneContext` `ctx`. 42cb93a386Sopenharmony_ci /// @param ctx the clone context 43cb93a386Sopenharmony_ci /// @return the newly cloned type 44cb93a386Sopenharmony_ci const F32* Clone(CloneContext* ctx) const override; 45cb93a386Sopenharmony_ci}; 46cb93a386Sopenharmony_ci 47cb93a386Sopenharmony_ci} // namespace ast 48cb93a386Sopenharmony_ci} // namespace tint 49cb93a386Sopenharmony_ci 50cb93a386Sopenharmony_ci#endif // SRC_AST_F32_H_ 51