diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-04-27 16:34:37 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-04-27 16:34:37 +0200 |
commit | 10b01c305ff73a9da40fb81b7f90312d1f79f037 (patch) | |
tree | 07689ae1cbd6c05fb9923ebb2f1de5e06a40674c /gcc/rust/resolve/rust-ast-resolve-path.h | |
parent | d69dd650367fa7fcfac38001b6406c1bff2601e1 (diff) | |
download | gcc-10b01c305ff73a9da40fb81b7f90312d1f79f037.zip gcc-10b01c305ff73a9da40fb81b7f90312d1f79f037.tar.gz gcc-10b01c305ff73a9da40fb81b7f90312d1f79f037.tar.bz2 |
ast: ResolvePath: Move into its own source file
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-path.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-path.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-path.h b/gcc/rust/resolve/rust-ast-resolve-path.h new file mode 100644 index 0000000..7a4413b --- /dev/null +++ b/gcc/rust/resolve/rust-ast-resolve-path.h @@ -0,0 +1,49 @@ +// Copyright (C) 2020-2022 Free Software Foundation, Inc. + +// This file is part of GCC. + +// GCC is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 3, or (at your option) any later +// version. + +// GCC is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. + +// You should have received a copy of the GNU General Public License +// along with GCC; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#ifndef RUST_AST_RESOLVE_PATH_H +#define RUST_AST_RESOLVE_PATH_H + +#include "rust-ast-resolve-base.h" + +namespace Rust { +namespace Resolver { + +class ResolvePath : public ResolverBase +{ + using Rust::Resolver::ResolverBase::visit; + +public: + static void go (AST::PathInExpression *expr, NodeId parent); + static void go (AST::QualifiedPathInExpression *expr, NodeId parent); + +private: + ResolvePath (NodeId parent) : ResolverBase (parent) {} + + void resolve_path (AST::PathInExpression *expr); + void resolve_path (AST::QualifiedPathInExpression *expr); + + void resolve_segments (CanonicalPath prefix, size_t offs, + std::vector<AST::PathExprSegment> &segs, + NodeId expr_node_id, Location expr_locus); +}; + +} // namespace Resolver +} // namespace Rust + +#endif // !RUST_AST_RESOLVE_PATH_H |