[CUDA] Make the new driver properly ignore non-CUDA inputs
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 15 Jul 2022 17:52:27 +0000 (13:52 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 15 Jul 2022 21:38:34 +0000 (17:38 -0400)
commitbb957a8d524cd38d6c5f7d547302258026049438
tree0b5e8998af8eef21fc71075cd78d36fd5a401e1f
parentf32ccc2cca1df39e0f5b5aac0ec30d490104b58c
[CUDA] Make the new driver properly ignore non-CUDA inputs

The new driver generated offloadinga actions for each active toolchain.
However, for CUDA and HIP it is possible for the toolchain to be active
but one of the files is not a valid input. This can occur if the user
compiles both a CUDA and C source file in the same compiler invocation.
This patch adds some simple logic to quit if the input is not valid as
well.

Reviewed By: tra, MaskRay

Differential Revision: https://reviews.llvm.org/D129885
clang/lib/Driver/Driver.cpp
clang/test/Driver/cuda-phases.cu