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

[CIR][CodeGen] initial support for dynamic_cast #426

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

Lancern
Copy link
Member

@Lancern Lancern commented Jan 28, 2024

This PR introduces CIR CodeGen support for dynamic_cast.

The full feature set of dynamic_cast is not fully implemented in this PR as it's already pretty large. This PR only include support for downcasting and sidecasting a pointer or reference. dynamic_cast<void *> is not yet implemented.

@bcardosolopes
Copy link
Member

@lanza just rebased and this has the side effect of breaking GH PR workflow, making it impossible to review, apologies. Please rebase!

This patch introduces CIR CodeGen support for dynamic_cast. As an initial step,
this patch only adds support for cases where the destination type is not void*.
Support for dynamic_cast to void* will be added in future patches.
@Lancern
Copy link
Member Author

Lancern commented Jan 30, 2024

Please rebase!

@bcardosolopes Rebased.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Thanks for adding dynamic_cast support this is pretty cool and for your patience. Only few minor comments to address and it should be good to go!

clang/lib/CIR/CodeGen/CIRGenCall.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp Show resolved Hide resolved
clang/test/CIR/CodeGen/dynamic-cast.cpp Show resolved Hide resolved
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

This looks good, one one last minor changed needed (will pre-approve and merge once it's done)

clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp Show resolved Hide resolved
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Amazing, LGTM

@bcardosolopes bcardosolopes merged commit 00b21e0 into llvm:main Feb 2, 2024
5 of 6 checks passed
@Lancern Lancern deleted the dynamic-cast branch February 2, 2024 13:28
bcardosolopes pushed a commit that referenced this pull request Feb 2, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with #426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
bcardosolopes pushed a commit that referenced this pull request Feb 14, 2024
In #426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](#426 (comment)).
This PR adds it.
lanza pushed a commit that referenced this pull request Mar 23, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
lanza pushed a commit that referenced this pull request Mar 23, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with #426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
lanza pushed a commit that referenced this pull request Mar 23, 2024
In #426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](#426 (comment)).
This PR adds it.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with llvm#426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
In llvm#426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](llvm#426 (comment)).
This PR adds it.
lanza pushed a commit that referenced this pull request Apr 29, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
lanza pushed a commit that referenced this pull request Apr 29, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with #426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
lanza pushed a commit that referenced this pull request Apr 29, 2024
In #426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](#426 (comment)).
This PR adds it.
lanza pushed a commit that referenced this pull request Apr 29, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
lanza pushed a commit that referenced this pull request Apr 29, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with #426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
lanza pushed a commit that referenced this pull request Apr 29, 2024
In #426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](#426 (comment)).
This PR adds it.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with llvm#426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
In llvm#426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](llvm#426 (comment)).
This PR adds it.
lanza pushed a commit that referenced this pull request Apr 29, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
lanza pushed a commit that referenced this pull request Apr 29, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with #426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
lanza pushed a commit that referenced this pull request Apr 29, 2024
In #426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](#426 (comment)).
This PR adds it.
pysuxing pushed a commit to pysuxing/llvm-project that referenced this pull request Jul 17, 2024
In llvm#426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](llvm/clangir#426 (comment)).
This PR adds it.
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with llvm#426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with llvm#426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
In llvm#426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](llvm#426 (comment)).
This PR adds it.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with llvm#426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
In llvm#426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](llvm#426 (comment)).
This PR adds it.
lanza pushed a commit that referenced this pull request Nov 5, 2024
This PR introduces CIR CodeGen support for `dynamic_cast`.

The full feature set of `dynamic_cast` is not fully implemented in this
PR as it's already pretty large. This PR only include support for
downcasting and sidecasting a pointer or reference. `dynamic_cast<void
*>` is not yet implemented.
lanza pushed a commit that referenced this pull request Nov 5, 2024
This patch adds CIRGen for downcasting a pointer to the complete object
through `dynamic_cast<void *>`.

Together with #426 , the full functionality of `dynamic_cast` should be
supported in CIRGen after this PR merges.
lanza pushed a commit that referenced this pull request Nov 5, 2024
In #426 we confirmed that CIR needs a `cir.unreachable` operation to
mark unreachable program points
[(discussion)](#426 (comment)).
This PR adds it.
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.

2 participants