[PATCH] D19180: [CUDA] Raise an error if the CUDA install can't be found.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 15 17:16:43 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL266496: [CUDA] Raise an error if the CUDA install can't be found. (authored by jlebar).
Changed prior to commit:
http://reviews.llvm.org/D19180?vs=53954&id=53973#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19180
Files:
cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
cfe/trunk/lib/Driver/ToolChains.cpp
Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4118,11 +4118,14 @@
if (DriverArgs.hasArg(options::OPT_nocudainc))
return;
- if (CudaInstallation.isValid()) {
- addSystemInclude(DriverArgs, CC1Args, CudaInstallation.getIncludePath());
- CC1Args.push_back("-include");
- CC1Args.push_back("__clang_cuda_runtime_wrapper.h");
+ if (!CudaInstallation.isValid()) {
+ getDriver().Diag(diag::err_drv_no_cuda_installation);
+ return;
}
+
+ addSystemInclude(DriverArgs, CC1Args, CudaInstallation.getIncludePath());
+ CC1Args.push_back("-include");
+ CC1Args.push_back("__clang_cuda_runtime_wrapper.h");
}
bool Linux::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
Index: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
@@ -23,6 +23,9 @@
def err_drv_invalid_arch_name : Error<
"invalid arch name '%0'">;
def err_drv_cuda_bad_gpu_arch : Error<"Unsupported CUDA gpu architecture: %0">;
+def err_drv_no_cuda_installation : Error<
+ "cannot find CUDA installation. Provide its path via --cuda-path, or pass "
+ "-nocudainc to build without CUDA includes.">;
def err_drv_invalid_thread_model_for_target : Error<
"invalid thread model '%0' in '%1' for this target">;
def err_drv_invalid_linker_name : Error<
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19180.53973.patch
Type: text/x-patch
Size: 1601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160416/d893b4cc/attachment-0001.bin>
More information about the cfe-commits
mailing list