[cfe-dev] [PATCH] mark need for struct return ABI in block header

Blaine Garst blaine at apple.com
Wed Mar 3 17:44:22 PST 2010


There are runtime clients of blocks that need to introspect and invoke a block "by hand".  On x86 large structures are passed as an address of a stack local as the first parameter.  "Blind" clients of a void* block API, like runtimes, need to know the difference.

This patch gathers the appropriate info and marks the block header for both global and local blocks.  The ABI history of the flags is introduced in a comment.  The new feature is marked with what amounts as a combo of the reintroduced (1<<29) field and the just introduced block signature marker (1<<30).

Unfortunately in my last patch I forgot to rename the macro that marks the signature field, so the macro name changes from the last patch to name its actual use but nothing else.

A unit test is attached which tests both i386 and x86_64.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-1.patch
Type: application/octet-stream
Size: 2800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100303/dc627fce/attachment.obj>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: blockstret.c
Type: application/octet-stream
Size: 3422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100303/dc627fce/attachment-0001.obj>
-------------- next part --------------


Blaine


More information about the cfe-dev mailing list