-
Notifications
You must be signed in to change notification settings - Fork 1
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
Vector deleting destructors #3
base: main
Are you sure you want to change the base?
Conversation
to scalar properly
TODO:
|
if (RD->hasDefinition() && !RD->hasTrivialDestructor()) { | ||
// FIXME: check devirtualization? | ||
const CXXDestructorDecl *Dtor = RD->getDestructor(); | ||
RequiresVectorDestructor = Dtor->isVirtual(); |
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.
This is likely wrong. 3 is passed even when the destructor is not virtual at all.
// llvm::Value *LoadThisForDtorDelete(CodeGenFunction &CGF, | ||
// const CXXDestructorDecl *DD) { | ||
// if (Expr *ThisArg = DD->getOperatorDeleteThisArg()) | ||
// return CGF.EmitScalarExpr(ThisArg); | ||
// return CGF.LoadCXXThis(); | ||
// } |
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.
// llvm::Value *LoadThisForDtorDelete(CodeGenFunction &CGF, | |
// const CXXDestructorDecl *DD) { | |
// if (Expr *ThisArg = DD->getOperatorDeleteThisArg()) | |
// return CGF.EmitScalarExpr(ThisArg); | |
// return CGF.LoadCXXThis(); | |
// } |
// FIXME: Actually, the dtor thunk should be emitted for vector deleting | ||
// dtors rather than scalar deleting dtors. Just use the vector deleting dtor | ||
// mangling manually until we support both deleting dtor types. |
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.
See into that fixme
if (Context.getTargetInfo().getCXXABI().isMicrosoft()) | ||
Out << "() [vector deleting]"; | ||
else | ||
Out << "() [deleting]"; |
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.
Out << "() [deleting]"; | |
Out << "() [scalar deleting]"; |
|
||
void adjustCallArgsForDestructorThunk(CodeGenFunction &CGF, GlobalDecl GD, | ||
CallArgList &CallArgs) override { | ||
assert(GD.getDtorType() == Dtor_Deleting && | ||
"Only deleting destructor thunks are available in this ABI"); | ||
// assert(GD.getDtorType() == Dtor_Deleting && |
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.
Can it be a scalar deleting dtor?
if (isa<CXXDestructorDecl>(GD.getDecl())) | ||
assert(GD.getDtorType() == Dtor_Deleting); | ||
if (isa<CXXDestructorDecl>(GD.getDecl())) { | ||
assert(GD.getDtorType() == Dtor_Deleting || |
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.
assert(GD.getDtorType() == Dtor_Deleting || | |
assert( |
Sometimes new[] expression ends up in a function that is itself deferred so we first emit scalar destructor as a deferred decl then meet new[] for the type. Need to switch to vector deleting dtor then.
No description provided.