-
Notifications
You must be signed in to change notification settings - Fork 165
[CIR] Implement virtual destructor call #1856
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
base: main
Are you sure you want to change the base?
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, some nits
clang/test/CIR/CodeGen/virtual-destructor-explicit-unqualified-call.cpp
Outdated
Show resolved
Hide resolved
clang/test/CIR/CodeGen/virtual-destructor-explicit-unqualified-call.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CIRGen lgtm
Some more changes for the test to format it correctly and make it more readable.
clang/test/CIR/CodeGen/virtual-destructor-explicit-unqualified-call.cpp
Outdated
Show resolved
Hide resolved
clang/test/CIR/CodeGen/virtual-destructor-explicit-unqualified-call.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after minor comment
|
||
QualType thisTy = | ||
IsArrow ? Base->getType()->getPointeeType() : Base->getType(); | ||
emitCXXDestructorCall(globalDecl, callee, This.getPointer(), thisTy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some code repetition from the else
part, that can be improved overall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classic codegen, calls CGM.getCXXABI().EmitVirtualDestructorCall()
here. Is there a reason we can't do that?
// CIR-NEXT: %[[DTOR:.*]] = cir.load align(8) %[[DTOR_PTR]] : !cir.ptr<!cir.ptr<!cir.func<(!cir.ptr<!rec_A>)>>>, !cir.ptr<!cir.func<(!cir.ptr<!rec_A>)>> | ||
// CIR-NEXT: cir.call %[[DTOR]](%[[THIS]]) : (!cir.ptr<!cir.func<(!cir.ptr<!rec_A>)>>, !cir.ptr<!rec_A>) -> () | ||
// CIR-NEXT: cir.trap | ||
// CIR-NEXT: } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add LLVM
and OGCG
tests!
Implements #1812