Skip to content

Commit

Permalink
Remove query mode on CompileItem
Browse files Browse the repository at this point in the history
Query mode was a hack to catch up some compile errors early, it was
deemed to be removed at some time. Recent changes to NR1 highlighted
an incompatibility with it hence it's removal.

gcc/rust/ChangeLog:

	* backend/rust-compile-item.h: Remove query mode.
	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
	Likewise.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
  • Loading branch information
P-E-P committed Dec 12, 2024
1 parent 1ad6863 commit 9957c24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions gcc/rust/backend/rust-compile-item.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ class CompileItem : private HIRCompileBase, protected HIR::HIRStmtVisitor
public:
static tree compile (HIR::Item *item, Context *ctx,
TyTy::BaseType *concrete = nullptr,
bool is_query_mode = false,
location_t ref_locus = UNDEF_LOCATION)
{
CompileItem compiler (ctx, concrete, ref_locus);
item->accept_vis (compiler);

if (is_query_mode && compiler.reference == error_mark_node)
rust_internal_error_at (ref_locus, "failed to compile item: %s",
item->as_string ().c_str ());
if (compiler.reference == error_mark_node)
rust_debug ("failed to compile item: %s", item->as_string ().c_str ());

return compiler.reference;
}
Expand Down
6 changes: 2 additions & 4 deletions gcc/rust/backend/rust-compile-resolve-path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
if (auto resolved_item = ctx->get_mappings ().lookup_hir_item (ref))
{
if (!lookup->has_substitutions_defined ())
return CompileItem::compile (*resolved_item, ctx, nullptr, true,
expr_locus);
return CompileItem::compile (*resolved_item, ctx, nullptr, expr_locus);
else
return CompileItem::compile (*resolved_item, ctx, lookup, true,
expr_locus);
return CompileItem::compile (*resolved_item, ctx, lookup, expr_locus);
}
else if (auto hir_extern_item
= ctx->get_mappings ().lookup_hir_extern_item (ref))
Expand Down

0 comments on commit 9957c24

Please sign in to comment.