diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-03-10 18:10:06 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-22 20:01:30 +0000 |
commit | 280ac5bd99b4d66ea10d0aa8d4edba53bf460b10 (patch) | |
tree | e67968afbe4668e6a2679ed961d137cdb409166d /gcc/rust/backend/rust-compile-implitem.h | |
parent | eb33139efa7bbbd09ad26403c36a5dcf31e1b14e (diff) | |
download | gcc-280ac5bd99b4d66ea10d0aa8d4edba53bf460b10.zip gcc-280ac5bd99b4d66ea10d0aa8d4edba53bf460b10.tar.gz gcc-280ac5bd99b4d66ea10d0aa8d4edba53bf460b10.tar.bz2 |
Generics continued this adds more type resolution to ADT and Functions
Adds recursive generic argument handling for structs and functions. With a
new substitution mapper class to coerce the HIR::GenericArgs appropriately.
This is the building block to work on impl blocks with generics and
better Monomorphization support to handle duplicate functions etc.
Fixes: #236 #234 #235
Addresses: #237
Diffstat (limited to 'gcc/rust/backend/rust-compile-implitem.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-implitem.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-compile-implitem.h b/gcc/rust/backend/rust-compile-implitem.h index 202b868..0817424 100644 --- a/gcc/rust/backend/rust-compile-implitem.h +++ b/gcc/rust/backend/rust-compile-implitem.h @@ -91,7 +91,7 @@ public: return; } - TyTy::FnType *fntype = (TyTy::FnType *) fntype_tyty; + TyTy::FnType *fntype = static_cast<TyTy::FnType *> (fntype_tyty); // convert to the actual function type ::Btype *compiled_fn_type = TyTyResolveCompile::compile (ctx, fntype); @@ -108,7 +108,7 @@ public: Bfunction *fndecl = ctx->get_backend ()->function (compiled_fn_type, fn_identifier, asm_name, flags, function.get_locus ()); - ctx->insert_function_decl (function.get_mappings ().get_hirid (), fndecl); + ctx->insert_function_decl (fntype->get_ty_ref (), fndecl); // setup the params @@ -256,7 +256,7 @@ public: return; } - TyTy::FnType *fntype = (TyTy::FnType *) fntype_tyty; + TyTy::FnType *fntype = static_cast<TyTy::FnType *> (fntype_tyty); // convert to the actual function type ::Btype *compiled_fn_type = TyTyResolveCompile::compile (ctx, fntype); @@ -273,7 +273,7 @@ public: Bfunction *fndecl = ctx->get_backend ()->function (compiled_fn_type, fn_identifier, asm_name, flags, method.get_locus ()); - ctx->insert_function_decl (method.get_mappings ().get_hirid (), fndecl); + ctx->insert_function_decl (fntype->get_ty_ref (), fndecl); // setup the params TyTy::BaseType *tyret = fntype->get_return_type (); |