[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 06:02:53 PDT 2018


yaxunl added a comment.

This patch also adds check for array of structs. Can you include this in title or split to a separate patch?



================
Comment at: lib/Sema/SemaDecl.cpp:8065
+        std::find(Names.begin(), Names.end(), DesugaredTy.getAsString());
+    if (Names.end() != Match)
+      return true;
----------------
Can we record the real size_t/intptr_t/etc typedef and later on emit a note for it? It helps user to locate the culprit typedef in case of multiple typedefs.


================
Comment at: lib/Sema/SemaDecl.cpp:8189
+  const RecordType *RecTy =
+      PT->getPointeeOrArrayElementType()->getAs<RecordType>();
+  const RecordDecl *OrigRecDecl = RecTy->getDecl();
----------------
Can we have a test for this change? e.g. an array of structs


Repository:
  rC Clang

https://reviews.llvm.org/D49725





More information about the cfe-commits mailing list