[PATCH] D16686: [OpenCL] Generate metadata for opencl_unroll_hint attribute

Xiuli PAN via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 18:24:23 PST 2016


pxli168 added inline comments.

================
Comment at: lib/Sema/SemaStmtAttr.cpp:216
@@ +215,3 @@
+    S.Diag(A.getLoc(), diag::err_attribute_too_many_arguments)
+        << "opencl_unroll_hint" << 1;
+    return nullptr;
----------------
I think you should not use hard code here, just use A.getName(). And diag will find a good way to output is.

================
Comment at: lib/Sema/SemaStmtAttr.cpp:230
@@ +229,3 @@
+          << A.getName()->getName() << AANT_ArgumentIntegerConstant
+          << E->getSourceRange();
+      return 0;
----------------
I think diag did not need StringRef, A.getName() is enough. It is Diag's job to find the best output form.


http://reviews.llvm.org/D16686





More information about the cfe-commits mailing list