1 // Copyright (C) 2020-2024 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_COMPILE_FNPARAM
20 #define RUST_COMPILE_FNPARAM
22 #include "rust-compile-base.h"
27 class CompileFnParam
: private HIRCompileBase
, protected HIR::HIRPatternVisitor
30 static Bvariable
*compile (Context
*ctx
, tree fndecl
,
31 HIR::FunctionParam
*param
, tree decl_type
,
33 static Bvariable
*compile (Context
*ctx
, tree fndecl
, HIR::Pattern
*param
,
34 tree decl_type
, Location locus
);
36 void visit (HIR::IdentifierPattern
&pattern
) override
;
37 void visit (HIR::WildcardPattern
&pattern
) override
;
38 void visit (HIR::StructPattern
&) override
;
39 void visit (HIR::TupleStructPattern
&) override
;
41 // Empty visit for unused Pattern HIR nodes.
42 void visit (HIR::LiteralPattern
&) override
{}
43 void visit (HIR::PathInExpression
&) override
{}
44 void visit (HIR::QualifiedPathInExpression
&) override
{}
45 void visit (HIR::RangePattern
&) override
{}
46 void visit (HIR::ReferencePattern
&) override
{}
47 void visit (HIR::SlicePattern
&) override
{}
48 void visit (HIR::TuplePattern
&) override
{}
51 CompileFnParam (Context
*ctx
, tree fndecl
, tree decl_type
, Location locus
);
56 Bvariable
*compiled_param
;
59 class CompileSelfParam
: private HIRCompileBase
62 static Bvariable
*compile (Context
*ctx
, tree fndecl
, HIR::SelfParam
&self
,
63 tree decl_type
, Location locus
);
66 } // namespace Compile
69 #endif // RUST_COMPILE_FNPARAM