[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-12-01 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm closed this revision. arsenm added a comment. r348084 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55023/new/ https://reviews.llvm.org/D55023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mail

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-30 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm marked an inline comment as done. arsenm added inline comments. Comment at: test/SemaOpenCL/printf-format-strings.cl:65 +{ +printf("%v4f\n", arg); // expected-warning {{format specifies type 'double __attribute__((ext_vector_type(4)))' but the argument has type 'float

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Comment at: test/SemaOpenCL/printf-format-strings.cl:65 +{ +printf("%v4f\n", arg); // expected-warning {{format specifies type 'double __attribute__(

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm updated this revision to Diff 175920. arsenm added a comment. Add tests without fp64 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55023/new/ https://reviews.llvm.org/D55023 Files: include/clang/AST/FormatString.h lib/AST/FormatString.cpp lib/AST/FormatStringParsing.h li

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm marked an inline comment as done. arsenm added inline comments. Comment at: test/SemaOpenCL/printf-format-strings.cl:65 +{ +printf("%v4f\n", arg); // expected-warning {{format specifies type 'double __attribute__((ext_vector_type(4)))' but the argument has type 'float

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/printf-format-strings.cl:65 +{ +printf("%v4f\n", arg); // expected-warning {{format specifies type 'double __attribute__((ext_vector_type(4)))' but the argument has type 'float2' (vector of 2 'float' values)}} }

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm marked an inline comment as done. arsenm added inline comments. Comment at: test/SemaOpenCL/printf-format-strings.cl:65 +{ +printf("%v4f\n", arg); // expected-warning {{format specifies type 'double __attribute__((ext_vector_type(4)))' but the argument has type 'float

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm marked an inline comment as done and an inline comment as not done. arsenm added inline comments. Comment at: test/SemaOpenCL/printf-format-strings.cl:65 +{ +printf("%v4f\n", arg); // expected-warning {{format specifies type 'double __attribute__((ext_vector_type(4)))

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm marked 2 inline comments as done. arsenm added inline comments. Comment at: test/SemaOpenCL/format-strings-fixit.cl:13 +void vector_fixits() { +// printf("%f", (int) 123); + printf("%v4f", (int4) 123); Anastasia wrote: > Does this not work yet? It does.

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/format-strings-fixit.cl:13 +void vector_fixits() { +// printf("%f", (int) 123); + printf("%v4f", (int4) 123); Does this not work yet? Comment at: test/SemaOpenCL/printf-format-strin

[PATCH] D55023: OpenCL: Improve vector printf warnings

2018-11-28 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm created this revision. arsenm added a reviewer: Anastasia. Herald added subscribers: yaxunl, wdng. The vector modifier is considered separate, so don't treat it as a conversion specifier. This is still not warning on some cases, like using a type that isn't a valid vector element.