Page MenuHomePhabricator

[CodeGen] Fix assignments of inline layouts into the byref structure
ClosedPublic

Authored by vsk on Dec 19 2015, 9:19 PM.

Details

Summary

[CodeGen] Fix assignments of inline layouts into the byref structure

When using blocks, a byref structure is created to represent the
closure. The "byref.layout" field of this structure is an i8*. However,
some 'inline' layouts are represented as i64's, not i8*'s.

Prior to r246985 we cast the i64 'inline' layout to an i8* before
assigning it into the byref structure. This patch brings the cast back
and adds a regression test.

rdar://23713871

Diff Detail

Event Timeline

vsk updated this revision to Diff 43316.Dec 19 2015, 9:19 PM
vsk retitled this revision from to [CodeGen] Fix assignments of inline layouts into the byref structure.
vsk updated this object.
vsk added a reviewer: rjmccall.
vsk added a subscriber: cfe-commits.
rjmccall edited edge metadata.Dec 21 2015, 9:58 AM

You don't need a CodeGenFunction for this; just use llvm::ConstantExpr::getBitCast. Please document the requirement that this returns an i8* in CGObjCRuntime.h.

vsk updated this revision to Diff 43384.Dec 21 2015, 10:29 AM
vsk edited edge metadata.
  • Update patch according to John's comments.

Thank you, that's great. LGTM.

vsk added a comment.Dec 21 2015, 11:34 AM

Thanks for the review. Committed r256185

vsk accepted this revision.May 10 2016, 11:19 AM
vsk added a reviewer: vsk.

Closing old review.

This revision is now accepted and ready to land.May 10 2016, 11:19 AM
vsk closed this revision.May 10 2016, 11:19 AM