Page MenuHomePhabricator

Add clang cc1 option to generate OpenCL builtin functions
ClosedPublic

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

Details

Reviewers
svenvh
Anastasia
Summary

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 https://reviews.llvm.org/D60763

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
clang/include/clang/Driver/CC1Options.td
755

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 https://reviews.llvm.org/D60763 which was merged.