From 95e8c2d54f4b865206766db74c178ba134a1ab9d Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Wed, 12 Jul 2023 13:36:15 -0400 Subject: Remove Linemap::predeclared_location gcc/rust/ChangeLog: * rust-linemap.h (Linemap::predeclared_location): Remove. * backend/rust-compile-type.cc: Replace Linemap::predeclared_location with BUILTINS_LOCATION. * resolve/rust-name-resolver.cc: Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. Signed-off-by: Owen Avery --- gcc/rust/resolve/rust-name-resolver.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'gcc/rust/resolve') diff --git a/gcc/rust/resolve/rust-name-resolver.cc b/gcc/rust/resolve/rust-name-resolver.cc index b8ed353..7bb123b 100644 --- a/gcc/rust/resolve/rust-name-resolver.cc +++ b/gcc/rust/resolve/rust-name-resolver.cc @@ -366,9 +366,8 @@ Resolver::insert_builtin_types (Rib *r) CanonicalPath builtin_path = CanonicalPath::new_seg (builtin->get_node_id (), builtin->as_string ()); - r->insert_name (builtin_path, builtin->get_node_id (), - Linemap::predeclared_location (), false, - Rib::ItemType::Type, + r->insert_name (builtin_path, builtin->get_node_id (), BUILTINS_LOCATION, + false, Rib::ItemType::Type, [] (const CanonicalPath &, NodeId, Location) -> void {}); } } @@ -436,7 +435,7 @@ Resolver::generate_builtins () = TyTy::TupleType::get_unit_type (mappings->get_next_hir_id ()); std::vector > elems; AST::TupleType *unit_type - = new AST::TupleType (std::move (elems), Linemap::predeclared_location ()); + = new AST::TupleType (std::move (elems), BUILTINS_LOCATION); builtins.push_back (unit_type); tyctx->insert_builtin (unit_tyty->get_ref (), unit_type->get_node_id (), unit_tyty); @@ -446,15 +445,13 @@ Resolver::generate_builtins () void Resolver::setup_builtin (const std::string &name, TyTy::BaseType *tyty) { - AST::PathIdentSegment seg (name, Linemap::predeclared_location ()); + AST::PathIdentSegment seg (name, BUILTINS_LOCATION); auto typePath = ::std::unique_ptr ( - new AST::TypePathSegment (::std::move (seg), false, - Linemap::predeclared_location ())); + new AST::TypePathSegment (::std::move (seg), false, BUILTINS_LOCATION)); ::std::vector< ::std::unique_ptr > segs; segs.push_back (::std::move (typePath)); auto builtin_type - = new AST::TypePath (::std::move (segs), Linemap::predeclared_location (), - false); + = new AST::TypePath (::std::move (segs), BUILTINS_LOCATION, false); builtins.push_back (builtin_type); tyctx->insert_builtin (tyty->get_ref (), builtin_type->get_node_id (), tyty); mappings->insert_node_to_hir (builtin_type->get_node_id (), tyty->get_ref ()); -- cgit v1.1