1 // Copyright 2021 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_SEM_LOOP_STATEMENT_H_ 16 #define SRC_SEM_LOOP_STATEMENT_H_ 17 18 #include "src/sem/block_statement.h" 19 20 // Forward declarations 21 namespace tint { 22 namespace ast { 23 class LoopStatement; 24 } // namespace ast 25 } // namespace tint 26 27 namespace tint { 28 namespace sem { 29 30 /// Holds semantic information about a loop statement 31 class LoopStatement : public Castable<LoopStatement, CompoundStatement> { 32 public: 33 /// Constructor 34 /// @param declaration the AST node for this loop statement 35 /// @param parent the owning statement 36 /// @param function the owning function 37 LoopStatement(const ast::LoopStatement* declaration, 38 const CompoundStatement* parent, 39 const sem::Function* function); 40 41 /// Destructor 42 ~LoopStatement() override; 43 }; 44 45 /// Holds semantic information about a loop continuing block 46 class LoopContinuingBlockStatement 47 : public Castable<LoopContinuingBlockStatement, BlockStatement> { 48 public: 49 /// Constructor 50 /// @param declaration the AST node for this block statement 51 /// @param parent the owning statement 52 /// @param function the owning function 53 LoopContinuingBlockStatement(const ast::BlockStatement* declaration, 54 const CompoundStatement* parent, 55 const sem::Function* function); 56 57 /// Destructor 58 ~LoopContinuingBlockStatement() override; 59 }; 60 61 } // namespace sem 62 } // namespace tint 63 64 #endif // SRC_SEM_LOOP_STATEMENT_H_ 65