From 82d9bd0b033acb555b629dc527b32d4e510ba69a Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 30 May 2023 12:10:40 +0100 Subject: gccrs: remove useless lookup to NodeId gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): remove unused Signed-off-by: Philip Herron --- gcc/rust/backend/rust-compile-expr.cc | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index b35db09..c907acb 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -1698,23 +1698,6 @@ CompileExpr::visit (HIR::MethodCallExpr &expr) // method receiver tree self = CompileExpr::Compile (expr.get_receiver ().get (), ctx); - // lookup the resolved name - NodeId resolved_node_id = UNKNOWN_NODEID; - if (!ctx->get_resolver ()->lookup_resolved_name ( - expr.get_mappings ().get_nodeid (), &resolved_node_id)) - { - rust_error_at (expr.get_locus (), "failed to lookup resolved MethodCall"); - return; - } - - // reverse lookup - HirId ref; - if (!ctx->get_mappings ()->lookup_node_to_hir (resolved_node_id, &ref)) - { - rust_fatal_error (expr.get_locus (), "reverse lookup failure"); - return; - } - // lookup the expected function type TyTy::BaseType *lookup_fntype = nullptr; bool ok = ctx->get_tyctx ()->lookup_type ( @@ -1871,20 +1854,10 @@ CompileExpr::resolve_operator_overload ( expr.get_mappings ().get_hirid (), &fntype); rust_assert (is_op_overload); - // lookup the resolved name - NodeId resolved_node_id = UNKNOWN_NODEID; - bool ok = ctx->get_resolver ()->lookup_resolved_name ( - expr.get_mappings ().get_nodeid (), &resolved_node_id); - rust_assert (ok); - - // reverse lookup - HirId ref; - ok = ctx->get_mappings ()->lookup_node_to_hir (resolved_node_id, &ref); - rust_assert (ok); - TyTy::BaseType *receiver = nullptr; - ok = ctx->get_tyctx ()->lookup_receiver (expr.get_mappings ().get_hirid (), - &receiver); + bool ok + = ctx->get_tyctx ()->lookup_receiver (expr.get_mappings ().get_hirid (), + &receiver); rust_assert (ok); bool is_generic_receiver = receiver->get_kind () == TyTy::TypeKind::PARAM; -- cgit v1.1