public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8560] gccrs: nr2.0: Store mappings in NameResolutionContext
@ 2024-01-30 11:59 Arthur Cohen
0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-30 11:59 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:cb3a12f3ee26de1f51d9c900d4056fc4bcf6974f
commit r14-8560-gcb3a12f3ee26de1f51d9c900d4056fc4bcf6974f
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Tue Aug 22 15:40:25 2023 +0200
gccrs: nr2.0: Store mappings in NameResolutionContext
gcc/rust/ChangeLog:
* resolve/rust-name-resolution-context.h: Store a reference to the
mappings.
* resolve/rust-name-resolution-context.cc
(NameResolutionContext::NameResolutionContext): Likewise.
Diff:
---
gcc/rust/resolve/rust-name-resolution-context.cc | 4 ++++
gcc/rust/resolve/rust-name-resolution-context.h | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/gcc/rust/resolve/rust-name-resolution-context.cc b/gcc/rust/resolve/rust-name-resolution-context.cc
index 82771cdd923e..8bb7a9a15c10 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.cc
+++ b/gcc/rust/resolve/rust-name-resolution-context.cc
@@ -21,6 +21,10 @@
namespace Rust {
namespace Resolver2_0 {
+NameResolutionContext::NameResolutionContext ()
+ : mappings (*Analysis::Mappings::get ())
+{}
+
tl::expected<NodeId, DuplicateNameError>
NameResolutionContext::insert (Identifier name, NodeId id, Namespace ns)
{
diff --git a/gcc/rust/resolve/rust-name-resolution-context.h b/gcc/rust/resolve/rust-name-resolution-context.h
index 6d14be35986a..d63ee33378b8 100644
--- a/gcc/rust/resolve/rust-name-resolution-context.h
+++ b/gcc/rust/resolve/rust-name-resolution-context.h
@@ -21,6 +21,7 @@
#include "optional.h"
#include "rust-forever-stack.h"
+#include "rust-hir-map.h"
namespace Rust {
namespace Resolver2_0 {
@@ -136,6 +137,8 @@ correct
class NameResolutionContext
{
public:
+ NameResolutionContext ();
+
/**
* Insert a new value in the current rib.
*
@@ -174,6 +177,8 @@ public:
ForeverStack<Namespace::Types> types;
ForeverStack<Namespace::Macros> macros;
ForeverStack<Namespace::Labels> labels;
+
+ Analysis::Mappings &mappings;
};
} // namespace Resolver2_0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-30 11:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 11:59 [gcc r14-8560] gccrs: nr2.0: Store mappings in NameResolutionContext Arthur Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).