[PATCH] D28814: [OpenCL] Add missing address spaces in IR generation of Blocks

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 10:17:31 PST 2017

Anastasia created this revision.

ObjC IR generation for Blocks currently:
I. Generates local to block variable declaration block literal in case it contains captures.
II. Global variable block literal in case it doesn't have any captures.

The address spaces are missing however if we use this generation for OpenCL.

This patch:

- keeps default private address space for blocks generated as local variables (case I from above);
- adds global address space for global block literals (case II from the above);
- makes the block invoke function and enqueue_kernel prototype with the generic AS block pointer parameter to accommodate both private and global AS cases.
- adds block handling into default AS because it's implemented as a special pointer type (BlockPointer) in the frontend and therefore it is used as a pointer everywhere. This is also needed to accommodate both private and global address space blocks for the two cases described above.
- removes ObjC RT specific symbols (NSConcreteStackBlock and NSConcreteGlobalBlock) in the OpenCL mode.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28814.84694.patch
Type: text/x-patch
Size: 37717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170117/53172a31/attachment-0001.bin>

More information about the cfe-commits mailing list