bader added a comment.
LGTM
http://reviews.llvm.org/D19071
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
pxli168 added inline comments.
Comment at: lib/Frontend/InitPreprocessor.cpp:421
@@ +420,3 @@
+switch (LangOpts.OpenCLVersion) {
+case 0:
+case 100:
What is 0 stand for as OpenCLVersion, it seems the default OpenCLVersion if we
did not pass any -cl-st
yaxunl added inline comments.
Comment at: lib/Frontend/InitPreprocessor.cpp:421
@@ +420,3 @@
+switch (LangOpts.OpenCLVersion) {
+case 0:
+case 100:
pxli168 wrote:
> What is 0 stand for as OpenCLVersion, it seems the default OpenCLVersion if
> we did n
Anastasia added inline comments.
Comment at: lib/Frontend/InitPreprocessor.cpp:426
@@ +425,3 @@
+case 110:
+ Builder.defineMacro("__CLANG_OPENCL_C_VERSION__", "110");
+ break;
So why we can't use unified __OPENCL_C_VERSION__?
Commen
yaxunl marked 6 inline comments as done.
Comment at: lib/Frontend/InitPreprocessor.cpp:426
@@ +425,3 @@
+case 110:
+ Builder.defineMacro("__CLANG_OPENCL_C_VERSION__", "110");
+ break;
Anastasia wrote:
> So why we can't use unified __OPENCL_C_VERSION_
Anastasia added inline comments.
Comment at: lib/Frontend/InitPreprocessor.cpp:439
@@ +438,3 @@
+if (LangOpts.OpenCLVersion >= 110)
+ Builder.defineMacro("CL_VERSION_1_1", "110");
+if (LangOpts.OpenCLVersion >= 120)
yaxunl wrote:
> yaxunl wrote:
> > p
yaxunl marked 7 inline comments as done.
Comment at: lib/Frontend/InitPreprocessor.cpp:421
@@ +420,3 @@
+switch (LangOpts.OpenCLVersion) {
+case 0:
+case 100:
yaxunl wrote:
> pxli168 wrote:
> > What is 0 stand for as OpenCLVersion, it seems the default
yaxunl updated the summary for this revision.
yaxunl updated this revision to Diff 54243.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Added __OPENCL_C_VERSION__ and CL_VERSION_X_Y for all OpenCL versions.
Also fixed the test using -std=c99 for OpenCL and limit allowed languag
Anastasia added inline comments.
Comment at: lib/Frontend/InitPreprocessor.cpp:421
@@ +420,3 @@
+switch (LangOpts.OpenCLVersion) {
+case 100:
+ Builder.defineMacro("__OPENCL_C_VERSION__", "100");
Yes, perfectly makes sense. I don't think passing C std
yaxunl updated this revision to Diff 54404.
yaxunl added a comment.
Fix test/preprocessor/predefined_macros.c.
Merge test/frontend/std.cl into langstd.c since they are similar.
http://reviews.llvm.org/D19071
Files:
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/InitPreprocessor.cpp
tes
Anastasia added inline comments.
Comment at: lib/Frontend/InitPreprocessor.cpp:418
@@ +417,3 @@
+// A shared OpenCL header file requires a macro to indicate the language
+// standard. As a workaround, __CLANG_OPENCL_C_VERSION__ is defined for
+// OpenCL v1.0 and v1.1.
yaxunl updated this revision to Diff 54552.
yaxunl added a comment.
Revised as Anastasia suggested.
http://reviews.llvm.org/D19071
Files:
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/InitPreprocessor.cpp
test/Frontend/std.cl
test/Frontend/stdlang.c
test/Preprocessor/predefined-mac
Anastasia added inline comments.
Comment at: test/Preprocessor/predefined-macros.c:180
@@ +179,3 @@
+// CHECK-CL20: #define __OPENCL_C_VERSION__ 200
+// CHECK-FRM: #define __FAST_RELAXED_MATH__ 1
+
Could we also add CHECK-NOT for all the above cases to make sure
yaxunl updated this revision to Diff 55016.
yaxunl marked 4 inline comments as done.
yaxunl added a comment.
Add CHECK-NOT for `__FAST_RELAXED_MATH__`.
http://reviews.llvm.org/D19071
Files:
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/InitPreprocessor.cpp
test/Frontend/std.cl
test/F
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.
LGTM! Thanks!
http://reviews.llvm.org/D19071
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267590: [OpenCL] Add predefined macros. (authored by yaxunl).
Changed prior to commit:
http://reviews.llvm.org/D19071?vs=55016&id=55066#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19071
Files:
16 matches
Mail list logo