From: Arthur Cohen Date: Fri, 23 Jun 2023 14:35:47 +0000 (+0200) Subject: gccrs: session-manager: Run name resolution 2.0 if the option is present X-Git-Tag: basepoints/gcc-15~2250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=301e59b864ba32b6e69b906a11352863983c2572;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 3461198be957..401133c14dc8 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 ();