[PATCH] D16686: [OpenCL] Generate metadata for opencl_unroll_hint attribute
Xiuli PAN via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 4 19:38:50 PST 2016
pxli168 added a comment.
Hi Pekka/Anastasia,
I find that most of the attribute parses was done in ParseDecl.cpp, should this also be in there?
Thanks
Xiuli
================
Comment at: lib/Parse/ParseStmt.cpp:2214
@@ +2213,3 @@
+
+bool Parser::ParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs) {
+ MaybeParseGNUAttributes(Attrs);
----------------
I am wondering where should this function goes in, here or ParseDecl.cpp.
================
Comment at: lib/Parse/ParseStmt.cpp:2220
@@ +2219,3 @@
+
+ if (Attrs.getList()->getName()->getName() != "opencl_unroll_hint")
+ return true;
----------------
Using string is not very strict, can use AttributeList Kind to check that.
```
Attrs.getList()->getKind() != AttributeList::AT_OpenCLUnrollHint
```
================
Comment at: test/SemaOpenCL/unroll-hint.cl:1
@@ +1,2 @@
+//RUN: %clang_cc1 -O0 -fsyntax-only -verify %s
+
----------------
I think one test case here is enough, since they all hint the same code.
http://reviews.llvm.org/D16686
More information about the cfe-commits
mailing list