aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-var-decl.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-02-10 17:08:15 +0000
committerGitHub <noreply@github.com>2022-02-10 17:08:15 +0000
commite2823b6747b36362387e5b26e8792f06185d7de8 (patch)
treea1c1a61fd3031416ca3bc600212cd13e51f727b8 /gcc/rust/backend/rust-compile-var-decl.h
parentf6ba472caf42db1f5f2f98b73afccf448b36c322 (diff)
parent1b487d72cd2ba46671f5a1bcc20970f2dad1b759 (diff)
downloadgcc-e2823b6747b36362387e5b26e8792f06185d7de8.zip
gcc-e2823b6747b36362387e5b26e8792f06185d7de8.tar.gz
gcc-e2823b6747b36362387e5b26e8792f06185d7de8.tar.bz2
Merge #917
917: remove tree addressable context during type checking r=philberty a=philberty We can reuse more C front-end code c_mark_addressable can be used instead of trying to track TREE_ADDRESSABLE as part of type-checking. This also pulls the GCC::Backend::address_expression to be part of the HIRCompileBase class during code-generation. Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-var-decl.h')
-rw-r--r--gcc/rust/backend/rust-compile-var-decl.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/gcc/rust/backend/rust-compile-var-decl.h b/gcc/rust/backend/rust-compile-var-decl.h
index 48becfa..7bc37eb 100644
--- a/gcc/rust/backend/rust-compile-var-decl.h
+++ b/gcc/rust/backend/rust-compile-var-decl.h
@@ -20,7 +20,6 @@
#define RUST_COMPILE_VAR_DECL
#include "rust-compile-base.h"
-#include "rust-hir-address-taken.h"
namespace Rust {
namespace Compile {
@@ -47,9 +46,6 @@ public:
&resolved_type);
rust_assert (ok);
- address_taken_context->lookup_addess_taken (
- stmt.get_mappings ().get_hirid (), &address_taken);
-
translated_type = TyTyResolveCompile::compile (ctx, resolved_type);
stmt.get_pattern ()->accept_vis (*this);
}
@@ -62,33 +58,29 @@ public:
compiled_variable
= ctx->get_backend ()->local_variable (fndecl, pattern.get_identifier (),
translated_type, NULL /*decl_var*/,
- address_taken, locus);
+ locus);
}
void visit (HIR::WildcardPattern &pattern) override
{
translated_type = ctx->get_backend ()->immutable_type (translated_type);
+
compiled_variable
= ctx->get_backend ()->local_variable (fndecl, "_", translated_type,
- NULL /*decl_var*/, address_taken,
- locus);
+ NULL /*decl_var*/, locus);
}
private:
CompileVarDecl (Context *ctx, tree fndecl)
: HIRCompileBase (ctx), fndecl (fndecl),
translated_type (ctx->get_backend ()->error_type ()),
- compiled_variable (ctx->get_backend ()->error_variable ()),
- address_taken (false),
- address_taken_context (Resolver::AddressTakenContext::get ())
+ compiled_variable (ctx->get_backend ()->error_variable ())
{}
tree fndecl;
tree translated_type;
Location locus;
Bvariable *compiled_variable;
- bool address_taken;
- const Resolver::AddressTakenContext *address_taken_context;
};
} // namespace Compile