This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Stop treating OpenCL builtin functions as standard C library functions
ClosedPublic

Authored by yaxunl on Feb 2 2016, 9:41 AM.

Details

Summary

OpenCL v1.2 s6.9.f: The library functions defined in the C99 standard headers are not available.

This change stops treating OpenCL builtin functions as standard C library functions to eliminate warning messages about printf format string.

Differential Revision: http://reviews.llvm.org/D16812

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl updated this revision to Diff 46670.Feb 2 2016, 9:41 AM
yaxunl retitled this revision from to [OpenCL] Stop treating OpenCL builtin functions as standard C library functions.
yaxunl updated this object.
yaxunl added a subscriber: tstellarAMD.
Anastasia added inline comments.Feb 3 2016, 10:36 AM
test/SemaOpenCL/printf.cl
9 ↗(On Diff #46670)

I think it's more common to put "// expected-no-diagnostics" just after the RUN line.

yaxunl updated this revision to Diff 46830.Feb 3 2016, 1:26 PM

Revised as Anastasia suggested.

pxli168 added inline comments.Feb 3 2016, 6:57 PM
lib/AST/Decl.cpp
2735 ↗(On Diff #46830)

Keep the style to others comment and you can write like:
OpenCL v1.2 s6.9.f - the library functions....

You do not need to write about how or where you get this require, you just need to give the reference.

Anastasia accepted this revision.Feb 4 2016, 10:31 AM
Anastasia edited edge metadata.

LGTM! Please change the comment as suggested.

lib/AST/Decl.cpp
2735 ↗(On Diff #46830)

Upper case after "-" please :)

OpenCL v1.2 s6.9.f - The library functions....
This revision is now accepted and ready to land.Feb 4 2016, 10:31 AM
yaxunl updated this revision to Diff 46946.Feb 4 2016, 12:16 PM
yaxunl updated this object.
yaxunl edited edge metadata.

Revised as Xiuli suggested.

pxli168 accepted this revision.Feb 4 2016, 8:30 PM
pxli168 edited edge metadata.

LGTM, thanks!

yaxunl marked 3 inline comments as done.Feb 10 2016, 10:41 AM

ping

@pekka, if you don't have any additional comments here we will proceed committing it.

Thanks!

pekka.jaaskelainen edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.

Thanks! Committed with a slight change of putting the test into test/SemaOpenCL/builtin.cl. I think it belongs to the same category and I find it better to group related things. I hope you are fine with this.

I am OK with that. Thanks!