Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Avoid to-after-is double calls to RTTI in the type checker #4441

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

vlstill
Copy link
Contributor

@vlstill vlstill commented Feb 21, 2024

These calls are redundant and cost extra. While this probably has little impact of the compiler speed with the new RTTI, this way of using to also makes it easier to see the cast is properly checker.

Copy link
Collaborator

@fruffy fruffy left a comment

Choose a reason for hiding this comment

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

A lot of these can probably be const auto*?

@vlstill vlstill force-pushed the typechecking-avoid-double-rtti branch from 2d9c767 to d21395e Compare February 21, 2024 19:15
@vlstill
Copy link
Contributor Author

vlstill commented Feb 21, 2024

A lot of these can probably be const auto*?

probably... one day I will try to configure clang-tidy or something to add these automatically. Most of the type checker does not even use the auto * convention for pointers/IR nodes.

@vlstill vlstill enabled auto-merge (squash) February 21, 2024 19:17
@fruffy
Copy link
Collaborator

fruffy commented Feb 21, 2024

A lot of these can probably be const auto*?

probably... one day I will try to configure clang-tidy or something to add these automatically. Most of the type checker does not even use the auto * convention for pointers/IR nodes.

Well... there is a PR open which adds clang-tidy support to our CMake. 😉
We can run it selectively. Maybe it is even possible to parametrize it.

Copy link
Contributor

@asl asl left a comment

Choose a reason for hiding this comment

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

Lots of similar code everywhere, yes!

@vlstill vlstill merged commit 5f9cb55 into p4lang:main Feb 21, 2024
16 checks passed
@vlstill vlstill deleted the typechecking-avoid-double-rtti branch February 21, 2024 21:03
@vlstill vlstill self-assigned this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants