[PATCH] D15309: [CUDA] emit vtables only for classes with methods usable on this side of compilation.

Jacques Pienaar via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 03:10:12 PST 2015


jpienaar added a comment.

Looks good to me.


================
Comment at: lib/AST/RecordLayoutBuilder.cpp:2003
@@ +2002,3 @@
+        return nullptr;
+      if (!Context.getLangOpts().CUDAIsDevice && !MD->hasAttr<CUDAHostAttr>() &&
+          MD->hasAttr<CUDADeviceAttr>())
----------------
Add a comment to explain asymmetry. Perhaps a general comment at the start of this section explaining would be the most useful.

================
Comment at: test/CodeGenCUDA/device-vtable.cu:36
@@ +35,3 @@
+// only device methods would be available during host or device
+// compilation. For now we'll not emit such vtable at all.
+class HD  {
----------------
What is the current behavior in this case? Should an error be reported?


http://reviews.llvm.org/D15309





More information about the cfe-commits mailing list