This is an archive of the discontinued LLVM Phabricator instance.

[clang codegen] Fix __try/__finally blocks in C++ constructors.
ClosedPublic

Authored by efriedma on Oct 26 2022, 11:36 AM.

Details

Summary

We were crashing trying to construct a GlobalDecl from a CXXConstructorDecl in the mangler. Instead of trying to do that conversion, just pass down the original GlobalDecl.

The whole mangling scheme here doesn't really make sense to me, but I guess it doesn't really matter how we mangle these names as long as it doesn't crash.

Diff Detail

Event Timeline

efriedma created this revision.Oct 26 2022, 11:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2022, 11:36 AM
efriedma requested review of this revision.Oct 26 2022, 11:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2022, 11:36 AM
mstorsjo resigned from this revision.Oct 27 2022, 4:19 AM

Sorry, I know essentially nothing about this area...

rnk accepted this revision.Oct 27 2022, 12:16 PM

From what I know, we could always build the GlobalDecl with the base ctor/dtor variant. The complete and deleting variants always delegate to the base variants, and we will only ever emit the SEH funclets during emission of the base variant (?0 and ?1), but this seems like a perfectly fine solution.

lgtm

This revision is now accepted and ready to land.Oct 27 2022, 12:16 PM
This revision was landed with ongoing or failed builds.Nov 16 2022, 3:15 PM
This revision was automatically updated to reflect the committed changes.