Skip to content

Implement default HIR visitor class #3854

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sakupan102
Copy link
Contributor

@sakupan102 sakupan102 commented Jun 23, 2025

gcc/rust/ChangeLog:

	* Make-lang.in: Scaffolding new rust-hir-visitor files
	* hir/tree/rust-hir-visitor.h (class DefaultHIRVisitor): Declare default HIR visitor
	* hir/tree/rust-hir-visitor.cc: Define default HIR visitor

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@powerboat9
Copy link
Collaborator

@sakupan102 looks like some recent function renames broke a visitor -- should be a small fix

a99e869 for reference

@sakupan102 sakupan102 force-pushed the default-hir-visitor branch 3 times, most recently from 46608d0 to a808c52 Compare June 24, 2025 05:03
@dkm
Copy link
Member

dkm commented Jun 24, 2025

The changelog should point at item being modified.

	* Make-lang.in (GRS_OBJS): Scaffolding new rust-hir-visitor files.
	* hir/tree/rust-hir-visitor.h (DefaultHIRVisitor): New.
	* hir/tree/rust-hir-visitor.cc (DefaultHIRVisitor): Likewise.

gcc/rust/ChangeLog:

	* Make-lang.in: Scaffolding new rust-hir-visitor files
	* hir/tree/rust-hir-visitor.h (DefaultHIRVisitor): Declare default HIR visitor
	* hir/tree/rust-hir-visitor.cc  (DefaultHIRVisitor): Define default HIR visitor

Signed-off-by: Ryutaro Okada <1015ryu88@gmail.com>
@sakupan102 sakupan102 force-pushed the default-hir-visitor branch from a808c52 to 04855ce Compare June 24, 2025 13:05
Copy link
Member

@P-E-P P-E-P left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise this looks good.

@@ -0,0 +1,1179 @@
// Copyright (C) 2020-2024 Free Software Foundation, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright year should be 2025

#include "rust-hir-full-decls.h"
#include "rust-hir-visitor.h"
#include "rust-hir-full.h"
#include <memory>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a system header, please include rust-system.h instead.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

5 participants