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.get (),
34 : 8 : CanonicalPath::create_empty ());
35 : 8 : ResolveExternItem::go (item.get (), prefix, canonical_prefix);
36 : : }
37 : 8 : }
38 : :
39 : : void
40 : 3 : ResolveStmt::visit (AST::Trait &trait)
41 : : {
42 : 3 : ResolveTopLevel::go (&trait, prefix, canonical_prefix);
43 : 3 : ResolveItem::go (&trait, prefix, canonical_prefix);
44 : 3 : }
45 : :
46 : : void
47 : 0 : ResolveStmt::visit (AST::InherentImpl &impl_block)
48 : : {
49 : 0 : ResolveTopLevel::go (&impl_block, prefix, canonical_prefix);
50 : 0 : ResolveItem::go (&impl_block, prefix, canonical_prefix);
51 : 0 : }
52 : :
53 : : void
54 : 4 : ResolveStmt::visit (AST::TraitImpl &impl_block)
55 : : {
56 : 4 : ResolveTopLevel::go (&impl_block, prefix, canonical_prefix);
57 : 4 : ResolveItem::go (&impl_block, prefix, canonical_prefix);
58 : 4 : }
59 : :
60 : : } // namespace Resolver
61 : : } // namespace Rust
|