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 #ifndef SRC_AST_F32_H_
16 #define SRC_AST_F32_H_
17 
18 #include <string>
19 
20 #include "src/ast/type.h"
21 
22 namespace tint {
23 namespace ast {
24 
25 /// A float 32 type
26 class F32 : public Castable<F32, Type> {
27  public:
28   /// Constructor
29   /// @param pid the identifier of the program that owns this node
30   /// @param src the source of this node
31   F32(ProgramID pid, const Source& src);
32   /// Move constructor
33   F32(F32&&);
34   ~F32() override;
35 
36   /// @param symbols the program's symbol table
37   /// @returns the name for this type that closely resembles how it would be
38   /// declared in WGSL.
39   std::string FriendlyName(const SymbolTable& symbols) const override;
40 
41   /// Clones this type and all transitive types using the `CloneContext` `ctx`.
42   /// @param ctx the clone context
43   /// @return the newly cloned type
44   const F32* Clone(CloneContext* ctx) const override;
45 };
46 
47 }  // namespace ast
48 }  // namespace tint
49 
50 #endif  // SRC_AST_F32_H_
51