This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Switch from TransformExpr to TransformInitializer in places we need to revert initializer to it syntactic form for Sema
ClosedPublic

Authored by shafik on May 23 2023, 10:56 AM.

Details

Summary

In some cases we are using TransformExpr instead of TransformInitializer, this results in ExprWithCleanups being dropped and we are not emitting a destructor as a result.

This fixes: https://github.com/llvm/llvm-project/issues/62818

Diff Detail

Event Timeline

shafik created this revision.May 23 2023, 10:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 10:56 AM
shafik requested review of this revision.May 23 2023, 10:56 AM
shafik added a subscriber: NoQ.May 23 2023, 10:59 AM
shafik added inline comments.
clang/test/Analysis/missing-bind-temporary.cpp
10

@NoQ I had to update this test due to my fix, since this was documenting a flaw, I am not sure what you want to do with it.

I think it is still useful as a regression and or verification test but you may want to modify it differently.

Change looks good, test is overly specific IMO.

clang/test/CodeGenCXX/gh62818.cpp
28

This test seems a little overly specific, right? I suspect you really only need call{{.*}} <ctor>, copy and dtor here. The rest seems unnecessary.

shafik updated this revision to Diff 525248.May 24 2023, 10:25 AM
  • Update test gh62818.cpp to be more precise
Fznamznon added inline comments.
clang/test/CodeGenCXX/gh62818.cpp
2

Why no opaque pointers? AFAIK since LLVM 17 typed pointers are not supported.

shafik updated this revision to Diff 525385.May 24 2023, 5:37 PM
  • Update test
shafik marked 2 inline comments as done.May 24 2023, 5:38 PM
shafik added inline comments.
clang/test/CodeGenCXX/gh62818.cpp
2

I had copied it from another test and missed that aspect. It seems like a bunch of tests in that dir use this argument.

erichkeane accepted this revision.May 25 2023, 6:14 AM
This revision is now accepted and ready to land.May 25 2023, 6:14 AM
This revision was automatically updated to reflect the committed changes.
shafik marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2023, 9:51 AM