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
;
43 void visit (HIR::Module
&module
) override
;
44 void visit (HIR::TypeAlias
&type_alias
) override
;
45 void visit (HIR::StaticItem
&static_item
) override
;
46 void visit (HIR::Trait
&trait
) override
;
47 void visit (HIR::ImplBlock
&impl
) override
;
48 void visit (HIR::TypePath
&path
) override
;
49 void visit (HIR::QualifiedPathInType
&path
) override
;
52 // this seems like it should not be part of this visitor
53 void visit (HIR::TypePathSegmentFunction
&segment
) override
58 // nothing to do for these
59 void visit (HIR::ExternCrate
&crate
) override
{}
60 void visit (HIR::UseDeclaration
&use_decl
) override
{}
62 // nothing to do for these as they are taken care of by the
63 // hir-type-check-enumitem.h
64 void visit (HIR::EnumItemTuple
&) override
{}
65 void visit (HIR::EnumItemStruct
&) override
{}
66 void visit (HIR::EnumItem
&) override
{}
67 void visit (HIR::EnumItemDiscriminant
&) override
{}
70 TypeCheckStmt () : TypeCheckBase (), infered (nullptr) {}
72 TyTy::BaseType
*infered
;
75 } // namespace Resolver
78 #endif // RUST_HIR_TYPE_CHECK_STMT