[PATCH] D26668: [OpenCL] Minor cleanup to access attributes on images

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 07:18:10 PST 2016


aaron.ballman added inline comments.


================
Comment at: lib/Sema/SemaType.cpp:1212
 
-static StringRef getImageAccessAttrStr(AttributeList *attrs) {
+static OpenCLAccessAttr::Spelling getImageAccessAttr(AttributeList *attrs) {
   if (attrs) {
----------------
Since we're updating this, can you change `attrs` to `Attrs`, and maybe make it a `const AttributeList *`?


================
Comment at: lib/Sema/SemaType.cpp:1224
   }
-  return "";
+  return OpenCLAccessAttr::Keyword_read_only;
 }
----------------
The caller can no longer tell the difference between a real-only OpenCL access attribute and no OpenCL access attribute. I know that this was the effective behavior of the original code, but that's specific to the current use case, so I think this change is a tiny regression in the semantics.


================
Comment at: lib/Sema/SemaType.cpp:1629
+      Result = Context.Id##ROTy; break; \
+    default: assert(0 && "Unknown access attribute!"); \
+    } \
----------------
Just checking, but, has this situation already been diagnosed elsewhere?


Repository:
  rL LLVM

https://reviews.llvm.org/D26668





More information about the cfe-commits mailing list