[OpenMP] Fix embedding offload code when there is no offloading toolchain
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 10 May 2022 17:19:16 +0000 (13:19 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 10 May 2022 17:33:20 +0000 (13:33 -0400)
commit045665423e6e893ee168368dab10469c8d3168c5
tree041bf73d579778bc389e170465de30746c588024
parentce583b14b2ec37b1c168bb92020680cb452502b3
[OpenMP] Fix embedding offload code when there is no offloading toolchain

Summary:
We use the `--offload-new-driver` option to enable offload code
embedding. The check for when to do this was flawed and was enabling it
too early in the case of OpenMP, causing a segfault when dereferencing
the offloading toolchain.
clang/lib/Driver/ToolChains/Clang.cpp