Branch data Line data Source code
1 : : // Copyright (C) 2020-2024 Free Software Foundation, Inc.
2 : :
3 : : // This file is part of GCC.
4 : :
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
8 : : // version.
9 : :
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
13 : : // for more details.
14 : :
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/>.
18 : :
19 : : #include "rust-ast-resolve-toplevel.h"
20 : : #include "rust-ast-resolve-item.h"
21 : : #include "rust-ast-resolve-stmt.h"
22 : : #include "rust-ast-resolve-implitem.h"
23 : :
24 : : namespace Rust {
25 : : namespace Resolver {
26 : :
27 : : void
28 : 8 : ResolveStmt::visit (AST::ExternBlock &extern_block)
29 : : {
30 : 8 : resolve_visibility (extern_block.get_visibility ());
31 : 16 : for (auto &item : extern_block.get_extern_items ())
32 : : {
33 : 8 : ResolveToplevelExternItem::go (*item, CanonicalPath::create_empty ());
34 : 8 : ResolveExternItem::go (*item, prefix, canonical_prefix);
35 : : }
36 : 8 : }
37 : :
38 : : void
39 : 3 : ResolveStmt::visit (AST::Trait &trait)
40 : : {
41 : 3 : ResolveTopLevel::go (trait, prefix, canonical_prefix);
42 : 3 : ResolveItem::go (trait, prefix, canonical_prefix);
43 : 3 : }
44 : :
45 : : void
46 : 1 : ResolveStmt::visit (AST::InherentImpl &impl_block)
47 : : {
48 : 1 : ResolveTopLevel::go (impl_block, prefix, canonical_prefix);
49 : 1 : ResolveItem::go (impl_block, prefix, canonical_prefix);
50 : 1 : }
51 : :
52 : : void
53 : 4 : ResolveStmt::visit (AST::TraitImpl &impl_block)
54 : : {
55 : 4 : ResolveTopLevel::go (impl_block, prefix, canonical_prefix);
56 : 4 : ResolveItem::go (impl_block, prefix, canonical_prefix);
57 : 4 : }
58 : :
59 : : } // namespace Resolver
60 : : } // namespace Rust
|