This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen][ObjC] Destroy callee-destroyed arguments in the caller function when the receiver is nil
ClosedPublic

Authored by ahatanak on Dec 14 2020, 9:19 PM.

Details

Summary

Callee-destroyed arguments to a method have to be destroyed in the caller function when the receiver is nil as the method doesn't get executed. This fixes PR48207.

rdar://71808391

Diff Detail

Event Timeline

ahatanak created this revision.Dec 14 2020, 9:19 PM
ahatanak requested review of this revision.Dec 14 2020, 9:19 PM
lanza added a subscriber: lanza.Dec 22 2020, 4:24 PM

Hey @ahatanak, I've ran into this problem in my companies projects and was wondering what the status of this patch is?

rjmccall accepted this revision.Dec 23 2020, 2:51 PM

Functionally LGTM. Minor suggestion.

clang/lib/CodeGen/CGObjCMac.cpp
2169

Is this something that could reasonably just be a method on ParmVarDecl?

This revision is now accepted and ready to land.Dec 23 2020, 2:51 PM
ahatanak updated this revision to Diff 313881.Dec 28 2020, 11:50 AM
ahatanak marked an inline comment as done.

Make isParamDestroyedInCallee a method of ParmVarDecl.

This revision was landed with ongoing or failed builds.Dec 28 2020, 11:52 AM
This revision was automatically updated to reflect the committed changes.