Line data Source code
1 :
2 : // Copyright (C) 2020-2026 Free Software Foundation, Inc.
3 :
4 : // This file is part of GCC.
5 :
6 : // GCC is free software; you can redistribute it and/or modify it under
7 : // the terms of the GNU General Public License as published by the Free
8 : // Software Foundation; either version 3, or (at your option) any later
9 : // version.
10 :
11 : // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 : // WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 : // for more details.
15 :
16 : // You should have received a copy of the GNU General Public License
17 : // along with GCC; see the file COPYING3. If not see
18 : // <http://www.gnu.org/licenses/>.
19 :
20 : #ifndef RUST_HIR_ATTRS_H
21 : #define RUST_HIR_ATTRS_H
22 :
23 : #include "rust-ast.h"
24 :
25 : namespace Rust {
26 : namespace HIR {
27 :
28 21 : class WithOuterAttrs
29 : {
30 : protected:
31 : AST::AttrVec outer_attrs;
32 :
33 : public:
34 53570 : AST::AttrVec &get_outer_attrs () { return outer_attrs; }
35 30039 : const AST::AttrVec &get_outer_attrs () const { return outer_attrs; }
36 :
37 35916 : WithOuterAttrs (AST::AttrVec outer_attrs)
38 35916 : : outer_attrs (std::move (outer_attrs)){};
39 : };
40 :
41 10 : class WithInnerAttrs
42 : {
43 : protected:
44 : AST::AttrVec inner_attrs;
45 :
46 : public:
47 8349 : AST::AttrVec get_inner_attrs () const { return inner_attrs; }
48 :
49 43011 : WithInnerAttrs (AST::AttrVec inner_attrs)
50 43011 : : inner_attrs (std::move (inner_attrs)){};
51 : };
52 :
53 : } // namespace HIR
54 : } // namespace Rust
55 :
56 : #endif
|