[Clang] Do not crash when an invalid offload architecture is set
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 12 Oct 2022 16:31:46 +0000 (11:31 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 12 Oct 2022 19:07:52 +0000 (14:07 -0500)
commit8d72f445f79992fd860a73ca4ebd78c1bcc6324b
treebf5b408fb519a9a4c831b8d6d95c5e720e6307d0
parent9fa8f113f7d7edff12b0c01e41f44a3ff5a875f9
[Clang] Do not crash when an invalid offload architecture is set

If an invalid architecture is set we currently return an empty string.
This will cause the offloading toolchain to continue to be built and
hit an assertion elsewhere due to the invalid architecture. This patch
fixes that so we now correctly exit.

Reviewed By: tra

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