aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-implitem.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-01-25 16:34:18 +0000
committerGitHub <noreply@github.com>2022-01-25 16:34:18 +0000
commit5f2973fe0e322380bd5f3f4ea35b657efbf86efa (patch)
tree5c10c91f085cbe16316fd5dff0a611bbd40a0610 /gcc/rust/backend/rust-compile-implitem.h
parent3de87e620f8714278c273ec91dc6ec22347c188c (diff)
parentc8a0c6eb4b9ea3779f01418cfc97a6761ca4a957 (diff)
downloadgcc-5f2973fe0e322380bd5f3f4ea35b657efbf86efa.zip
gcc-5f2973fe0e322380bd5f3f4ea35b657efbf86efa.tar.gz
gcc-5f2973fe0e322380bd5f3f4ea35b657efbf86efa.tar.bz2
Merge #891
891: Remove hack to handle forward declared items r=philberty a=philberty We used to use a compile_fns flag as a method to handle the case of code such as: ```rust fn foo() { bar() } fn bar() { } ``` The compile_fns flag when set to false would allow us to do a toplevel scan to compile the initial fndecl prototype of the functions as a method of handling the case of the call to bar() within the body of foo. The backend is setup now that we can 'query_compile' by compiling the item as required with a cache if we have already done so. Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-implitem.h')
-rw-r--r--gcc/rust/backend/rust-compile-implitem.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/rust/backend/rust-compile-implitem.h b/gcc/rust/backend/rust-compile-implitem.h
index fd92b0f..d646c83 100644
--- a/gcc/rust/backend/rust-compile-implitem.h
+++ b/gcc/rust/backend/rust-compile-implitem.h
@@ -34,12 +34,12 @@ class CompileInherentImplItem : public HIRCompileBase
using Rust::Compile::HIRCompileBase::visit;
public:
- static tree Compile (HIR::ImplItem *item, Context *ctx, bool compile_fns,
+ static tree Compile (HIR::ImplItem *item, Context *ctx,
TyTy::BaseType *concrete = nullptr,
bool is_query_mode = false,
Location ref_locus = Location ())
{
- CompileInherentImplItem compiler (ctx, compile_fns, concrete, ref_locus);
+ CompileInherentImplItem compiler (ctx, concrete, ref_locus);
item->accept_vis (compiler);
if (is_query_mode
@@ -79,9 +79,6 @@ public:
void visit (HIR::Function &function) override
{
- if (!compile_fns)
- return;
-
TyTy::BaseType *fntype_tyty;
if (!ctx->get_tyctx ()->lookup_type (function.get_mappings ().get_hirid (),
&fntype_tyty))
@@ -305,14 +302,13 @@ public:
}
private:
- CompileInherentImplItem (Context *ctx, bool compile_fns,
- TyTy::BaseType *concrete, Location ref_locus)
- : HIRCompileBase (ctx), compile_fns (compile_fns), concrete (concrete),
+ CompileInherentImplItem (Context *ctx, TyTy::BaseType *concrete,
+ Location ref_locus)
+ : HIRCompileBase (ctx), concrete (concrete),
reference (ctx->get_backend ()->error_expression ()),
ref_locus (ref_locus)
{}
- bool compile_fns;
TyTy::BaseType *concrete;
tree reference;
Location ref_locus;