]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Give the builtin unit struct an actual locus
authorPhilip Herron <herron.philip@googlemail.com>
Thu, 27 Mar 2025 15:15:08 +0000 (15:15 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 31 Mar 2025 19:07:17 +0000 (21:07 +0200)
commit3ef5915e5f56c04f2e70638eaa46f0baa2a1c388
treef76ef591b1a7b916f29f1f3406f358a410704fbe
parent5ea9b77d2790177fc3e224140b1b671363f689f2
gccrs: Give the builtin unit struct an actual locus

This has been a pet peeve of mine for a while because the gimple never
emitted the struct () name properly it was always empty which for record
types they always require a real locus or they dont get a proper name.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::unit_expression): pass ctx
* backend/rust-compile-base.h: cant be static
* backend/rust-compile-intrinsic.cc (try_handler_inner): pass ctx
* backend/rust-compile-type.cc
(TyTyResolveCompile::get_unit_type): update to grab the first locus
(TyTyResolveCompile::visit): pass ctx
* backend/rust-compile-type.h: likewise

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-intrinsic.cc
gcc/rust/backend/rust-compile-type.cc
gcc/rust/backend/rust-compile-type.h