[OpenMP] Don't build the offloading driver without a source input
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 16 May 2022 16:26:32 +0000 (12:26 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Mon, 16 May 2022 22:19:02 +0000 (18:19 -0400)
commitb653b409ff44b09ade04bb6e579f5f9790424611
tree43dc8153f543a7190b8885bd66780d1e4b4ec141
parent5ffecd28c9fb3098049f0477759f779122153499
[OpenMP] Don't build the offloading driver without a source input

The Clang driver additional stages to build a complete offloading
program for applications using CUDA or OpenMP offloading. This normally
requires either a source file input or a valid object file to be
handled. This would cause problems when trying to compile an assembly or
LLVM IR file through clang with flags that would enable offloading. This
patch simply adds a check to prevent the offloading toolchain from being
used if we don't have a valid source file.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D125705
clang/lib/Driver/Driver.cpp
clang/test/Driver/openmp-offload-gpu-new.c