aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-06-23 16:35:47 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:00:27 +0100
commit301e59b864ba32b6e69b906a11352863983c2572 (patch)
tree47d2d58712a839908f85c8b53a384a21bf1d92b2 /gcc/rust/rust-session-manager.cc
parentf7084d487286e4c7ba2336b7fa567fc59def4c01 (diff)
downloadgcc-301e59b864ba32b6e69b906a11352863983c2572.zip
gcc-301e59b864ba32b6e69b906a11352863983c2572.tar.gz
gcc-301e59b864ba32b6e69b906a11352863983c2572.tar.bz2
gccrs: session-manager: Run name resolution 2.0 if the option is present
gcc/rust/ChangeLog: * rust-session-manager.cc (Session::expansion): Use new `Early` name resolution 2.0 pass
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r--gcc/rust/rust-session-manager.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 3461198..401133c 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -40,6 +40,8 @@
#include "rust-extern-crate.h"
#include "rust-attributes.h"
#include "rust-early-name-resolver.h"
+#include "rust-name-resolution-context.h"
+#include "rust-early-name-resolver-2.0.h"
#include "rust-cfg-strip.h"
#include "rust-expand-visitor.h"
#include "rust-unicode.h"
@@ -605,6 +607,7 @@ Session::compile_crate (const char *filename)
// resolution pipeline stage
Resolver::NameResolution::Resolve (parsed_crate);
+
if (options.dump_option_enabled (CompileOptions::RESOLUTION_DUMP))
{
// TODO: what do I dump here? resolved names? AST with resolved names?
@@ -876,7 +879,14 @@ Session::expansion (AST::Crate &crate)
while (!fixed_point_reached && iterations < cfg.recursion_limit)
{
CfgStrip ().go (crate);
- Resolver::EarlyNameResolver ().go (crate);
+
+ auto ctx = Resolver2_0::NameResolutionContext ();
+
+ if (flag_name_resolution_2_0)
+ Resolver2_0::Early (ctx).go (crate);
+ else
+ Resolver::EarlyNameResolver ().go (crate);
+
ExpandVisitor (expander).go (crate);
fixed_point_reached = !expander.has_changed ();