diff options
Diffstat (limited to 'gcc/rust/backend/rust-compile-stmt.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-stmt.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/gcc/rust/backend/rust-compile-stmt.h b/gcc/rust/backend/rust-compile-stmt.h index 10f9a52..24a2084 100644 --- a/gcc/rust/backend/rust-compile-stmt.h +++ b/gcc/rust/backend/rust-compile-stmt.h @@ -48,34 +48,6 @@ public: translated = CompileExpr::Compile (stmt.get_expr (), ctx); } - void visit (HIR::ConstantItem &constant) override - { - TyTy::BaseType *resolved_type = nullptr; - bool ok - = ctx->get_tyctx ()->lookup_type (constant.get_mappings ().get_hirid (), - &resolved_type); - rust_assert (ok); - - tree type = TyTyResolveCompile::compile (ctx, resolved_type); - tree value = CompileExpr::Compile (constant.get_expr (), ctx); - - const Resolver::CanonicalPath *canonical_path = nullptr; - ok = ctx->get_mappings ()->lookup_canonical_path ( - constant.get_mappings ().get_crate_num (), - constant.get_mappings ().get_nodeid (), &canonical_path); - rust_assert (ok); - - std::string ident = canonical_path->get (); - tree const_expr - = ctx->get_backend ()->named_constant_expression (type, ident, value, - constant.get_locus ()); - - ctx->push_const (const_expr); - ctx->insert_const_decl (constant.get_mappings ().get_hirid (), const_expr); - - translated = const_expr; - } - void visit (HIR::LetStmt &stmt) override { // nothing to do |