[PATCH] D23042: [CUDA] Do not allow using NVPTX target for host compilation.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 17:32:23 PDT 2016

jlebar added inline comments.

Comment at: lib/Driver/ToolChains.cpp:4834
@@ -4831,2 +4833,3 @@
+    getDriver().Diag(diag::err_drv_cuda_nvptx_host);
   return DAL;
IRL we talked about putting an assert() here and bailing out earlier.  Does that not work?

My hope was that we could avoid having to put checks everywhere that the -arch flag is non-empty.

Also, if we're going to print an error message saying "you can't use nvptx as the host compiler", it would be nice to do that at some point in the code where we have confidence that someone is actually trying to use nvptx as the host compiler, instead of assuming that, if we get here, that's what happened.


More information about the cfe-commits mailing list