aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2024-11-01 12:58:44 -0400
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-21 12:32:55 +0100
commit447d38419914eb287ce9413d90fe17f80ece3df2 (patch)
treea12462551cd1b9968bf5150de7433a5b2d259405 /gcc/rust/backend
parent0a30f01a61b7a945c29935bc6cb95cf1ba89bb91 (diff)
downloadgcc-447d38419914eb287ce9413d90fe17f80ece3df2.zip
gcc-447d38419914eb287ce9413d90fe17f80ece3df2.tar.gz
gcc-447d38419914eb287ce9413d90fe17f80ece3df2.tar.bz2
gccrs: Remove usage of Resolver::get_builtin_types
gcc/rust/ChangeLog: * backend/rust-compile-context.cc (Context::setup_builtins): Use TypeCheckContext::get_builtins instead of Resolver::get_builtin_types, TypeCheckContext::lookup_type_by_node_id, and TypeCheckContext::lookup_type. * typecheck/rust-hir-type-check.h (TypeCheckContext::get_builtins): Add. * typecheck/rust-typecheck-context.cc (TypeCheckContext::get_builtins): Add. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile-context.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/gcc/rust/backend/rust-compile-context.cc b/gcc/rust/backend/rust-compile-context.cc
index c80f956..86f0894 100644
--- a/gcc/rust/backend/rust-compile-context.cc
+++ b/gcc/rust/backend/rust-compile-context.cc
@@ -33,19 +33,8 @@ Context::Context ()
void
Context::setup_builtins ()
{
- auto builtins = resolver->get_builtin_types ();
- for (auto it = builtins.begin (); it != builtins.end (); it++)
- {
- HirId ref;
- bool ok = tyctx->lookup_type_by_node_id ((*it)->get_node_id (), &ref);
- rust_assert (ok);
-
- TyTy::BaseType *lookup;
- ok = tyctx->lookup_type (ref, &lookup);
- rust_assert (ok);
-
- TyTyResolveCompile::compile (this, lookup);
- }
+ for (auto &builtin : tyctx->get_builtins ())
+ TyTyResolveCompile::compile (this, builtin.get ());
}
hashval_t