]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/rust/typecheck/rust-hir-type-check-stmt.h
1 // Copyright (C) 2020-2023 Free Software Foundation, Inc.
3 // This file is part of GCC.
5 // GCC is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation; either version 3, or (at your option) any later
10 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 // You should have received a copy of the GNU General Public License
16 // along with GCC; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
19 #ifndef RUST_HIR_TYPE_CHECK_STMT
20 #define RUST_HIR_TYPE_CHECK_STMT
22 #include "rust-hir-type-check-base.h"
27 class TypeCheckStmt
: private TypeCheckBase
, private HIR::HIRStmtVisitor
30 static TyTy::BaseType
*Resolve (HIR::Stmt
*stmt
);
32 void visit (HIR::ExprStmtWithBlock
&stmt
) override
;
33 void visit (HIR::ExprStmtWithoutBlock
&stmt
) override
;
34 void visit (HIR::EmptyStmt
&stmt
) override
;
35 void visit (HIR::ExternBlock
&extern_block
) override
;
36 void visit (HIR::ConstantItem
&constant
) override
;
37 void visit (HIR::LetStmt
&stmt
) override
;
38 void visit (HIR::TupleStruct
&struct_decl
) override
;
39 void visit (HIR::Enum
&enum_decl
) override
;
40 void visit (HIR::StructStruct
&struct_decl
) override
;
41 void visit (HIR::Union
&union_decl
) override
;
42 void visit (HIR::Function
&function
) override
;
44 void visit (HIR::EnumItemTuple
&) override
47 void visit (HIR::EnumItemStruct
&) override
50 void visit (HIR::EnumItem
&item
) override
53 void visit (HIR::EnumItemDiscriminant
&) override
56 void visit (HIR::TypePathSegmentFunction
&segment
) override
59 void visit (HIR::TypePath
&path
) override
62 void visit (HIR::QualifiedPathInType
&path
) override
65 void visit (HIR::Module
&module
) override
68 void visit (HIR::ExternCrate
&crate
) override
71 void visit (HIR::UseDeclaration
&use_decl
) override
74 void visit (HIR::TypeAlias
&type_alias
) override
77 void visit (HIR::StaticItem
&static_item
) override
80 void visit (HIR::Trait
&trait
) override
83 void visit (HIR::ImplBlock
&impl
) override
88 TypeCheckStmt () : TypeCheckBase (), infered (nullptr) {}
90 TyTy::BaseType
*infered
;
93 } // namespace Resolver
96 #endif // RUST_HIR_TYPE_CHECK_STMT