]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Remove backend dependancy on resolution rib information
authorPhilip Herron <herron.philip@googlemail.com>
Mon, 2 Oct 2023 17:41:33 +0000 (18:41 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:47 +0000 (12:36 +0100)
commitb4fc851e3a01e708819ebfe1bfe4f2dc2ae9e5e7
tree59456c6557cd35d3ad230a74dc0f32eb396d2672
parent088e3b0b7af1b6a38057c8717227867831d00c5e
gccrs: Remove backend dependancy on resolution rib information

When making more desugaring for the HIR we can need to add new Let bindings
which will require namesolution information but also rib information for
which block the let binding is associated which was very unnessecary. This
patch simply updates the BLOCK_CONTEXT of the current scope as we are
compiling and encounter HIR::LetStmts instead of trying to do it all
upfront which lots of wierd checks

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::compile_locals_for_block): removed
* backend/rust-compile-base.h: update header
* backend/rust-compile-block.cc (CompileBlock::visit): remove old logic
* backend/rust-compile-expr.cc (CompileExpr::generate_closure_function): likewise
* backend/rust-compile-stmt.cc (CompileStmt::visit): likewise
* backend/rust-compile-var-decl.h: ensure we setup tuple bindings correctly

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-base.cc
gcc/rust/backend/rust-compile-base.h
gcc/rust/backend/rust-compile-block.cc
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/backend/rust-compile-stmt.cc
gcc/rust/backend/rust-compile-var-decl.h