This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Add builtin function extension handling
ClosedPublic

Authored by svenvh on Dec 13 2019, 9:48 AM.

Details

Summary

Provide a mechanism to attach OpenCL extension information to builtin
functions, so that their use can be restricted according to the
extension(s) the builtin is part of.

Patch by Pierre Gondois and Sven van Haastregt.

Diff Detail

Event Timeline

svenvh created this revision.Dec 13 2019, 9:48 AM
Anastasia accepted this revision.Dec 16 2019, 11:49 AM

LGTM! Thanks!

clang/lib/Sema/OpenCLBuiltins.td
51

Are we planning to add type extensions too? If not it might not be worth creating extra abstractions. :)

This revision is now accepted and ready to land.Dec 16 2019, 11:49 AM
Nicola accepted this revision.Dec 17 2019, 12:36 AM

Just a minor comment, can you address it before you submit? Thanks!

clang/lib/Sema/OpenCLBuiltins.td
1096

Should this be moved together with the other extensions defined above? It might make the file easier to navigate if all the extensions are in the same place (or all close to where they are used)

svenvh marked 2 inline comments as done.Dec 17 2019, 5:01 AM
svenvh added inline comments.
clang/lib/Sema/OpenCLBuiltins.td
51

Yes, type extensions are planned.

1096

I'll move it to the top for now.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2019, 2:16 AM