]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/rust/checks/errors/borrowck/rust-bir-visitor.h
48b67c0fead40ebfd25a3b84b8c3e3117001baec
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_BIR_VISITOR_H
20 #define RUST_BIR_VISITOR_H
26 class InitializerExpr
;
27 template <unsigned N
> class Operator
;
35 virtual void visit (Node
&node
) = 0;
36 virtual void visit (InitializerExpr
&expr
) = 0;
37 virtual void visit (Operator
<1> &expr
) = 0;
38 virtual void visit (Operator
<2> &expr
) = 0;
39 virtual void visit (BorrowExpr
&expr
) = 0;
40 virtual void visit (Assignment
&expr
) = 0;
41 virtual void visit (CallExpr
&expr
) = 0;
47 virtual void accept_vis (Visitor
&visitor
) = 0;
50 template <typename BASE
, typename T
> class VisitableImpl
: public BASE
53 void accept_vis (Visitor
&visitor
) override
55 visitor
.visit (static_cast<T
&> (*this));
62 #endif // RUST_BIR_VISITOR_H