From ca514784717ef9c8418968a60ed4641af78c7d7b Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Fri, 12 Feb 2021 14:57:11 +0000 Subject: Add ReferenceType with BorrowExpr and DereferenceExpr This also adds in the mising InferenceType _ which was mostly implemented before as part of Data Structures 1. We create GENERIC REFERENCE_TYPES for these this is the building block to finish work on mutability rules and pointers. Fixes: #196 Addresses: #169 #170 --- gcc/rust/backend/rust-compile-context.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/rust/backend/rust-compile-context.h') diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h index 3955a5b..b50e103 100644 --- a/gcc/rust/backend/rust-compile-context.h +++ b/gcc/rust/backend/rust-compile-context.h @@ -445,6 +445,13 @@ public: translated = compiled_type; } + void visit (TyTy::ReferenceType &type) override + { + Btype *base_compiled_type + = TyTyResolveCompile::compile (ctx, type.get_base ()); + translated = ctx->get_backend ()->reference_type (base_compiled_type); + } + private: TyTyResolveCompile (Context *ctx) : ctx (ctx) {} -- cgit v1.1