aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-06-23 16:35:47 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-08-03 17:36:42 +0000
commit980ef03bc57a723e6b7a74c2546c84ad529d93ac (patch)
tree9a065f33a55f7f55bdca6976314f5a88dbdc11e8 /gcc/rust
parentf868ca89b08359ba3954bcad2b0d6842cc1b2eee (diff)
downloadgcc-980ef03bc57a723e6b7a74c2546c84ad529d93ac.zip
gcc-980ef03bc57a723e6b7a74c2546c84ad529d93ac.tar.gz
gcc-980ef03bc57a723e6b7a74c2546c84ad529d93ac.tar.bz2
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')
-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 0d7d98f..3c00ccb 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 ();