Page MenuHomePhabricator

Add clang cc1 option to generate OpenCL builtin functions

Authored by Pierre on Apr 16 2019, 1:51 AM.



Clang cc1 currently sets the -finclude-default-header flag by default, including the opencl-c.h header file. This patch adds a -fgenerate-opencl-builtin flag to generate OpenCL builtin functions with Tablegen. This flag overrides the -finclude-default-header flag.

This patch follows

Diff Detail

Event Timeline

Pierre created this revision.Apr 16 2019, 1:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2019, 1:51 AM
Anastasia added inline comments.Apr 16 2019, 7:28 AM

I feel may be it should be -fadd-opencl-builtins just to hide implementation details from the clang users.

Also the description should be something like:

"Add OpenCL builtin function definitions automatically..."

Pierre updated this revision to Diff 196474.Apr 24 2019, 9:52 AM
Pierre marked an inline comment as done.

The name of the command line option has been updated.

Anastasia accepted this revision.Apr 24 2019, 11:44 PM

LGTM! Thanks!

This revision is now accepted and ready to land.Apr 24 2019, 11:44 PM
Pierre updated this revision to Diff 196590.Apr 25 2019, 2:38 AM

Forgot to update one argument

Pierre closed this revision.Jun 18 2019, 9:34 AM

The changes are part of which was merged.