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

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 10:41:24 PST 2015


tra added inline comments.

================
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  {
----------------
jpienaar wrote:
> What is the current behavior in this case? Should an error be reported?
Hmm. nvcc actually accepts mixed virtual methods and generates vtable with NULL pointers for methods that are not available on particular side. That shifts responsibility to end-user which is
reasonable in this situation. A warning about partial availability of some virtual method would be helpful here, I think.

OK. Let me try matching nvcc's behavior and add a warning.


http://reviews.llvm.org/D15309





More information about the cfe-commits mailing list