[PATCH] D13168: [OpenCL] OpenCL2.0 - Apply default address space rules

Pekka Jääskeläinen via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 07:38:34 PDT 2015


pekka.jaaskelainen requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: lib/Sema/SemaType.cpp:6166
@@ -6166,2 +6165,3 @@
       attr.setUsedAsTypeAttr();
+      hasOpenCLAddressSpace = true;
       break;
----------------
Should this be below AttributeList::AT_OpenCLGenericAddressSpace? Does it now include the address space attribute even when used from C? Probably doesn't harm, but a bit misleading.

================
Comment at: lib/Sema/SemaType.cpp:6282
@@ +6281,3 @@
+    } else if (state.getCurrentChunkIndex() == 0 &&
+               D.getContext() == Declarator::FileContext &&
+               !D.isFunctionDeclarator() && !D.isFunctionDefinition() &&
----------------
Should this "white list" the cases where it's safe to add the default AS, not assume that it's applicable to any not listed here? Maybe safer that way.


http://reviews.llvm.org/D13168





More information about the cfe-commits mailing list