[openmp] Accept directory for libomptarget-bc-path
authorJon Chesterfield <jonathanchesterfield@gmail.com>
Wed, 1 Sep 2021 18:46:20 +0000 (19:46 +0100)
committerJon Chesterfield <jonathanchesterfield@gmail.com>
Wed, 1 Sep 2021 20:22:35 +0000 (21:22 +0100)
commitc7cbf1a03ea6f624be54370ea7b571842bc67dda
treefeb22411a4e220351806f6e5dbbce70eb4e8b76c
parent7f058ce8c2cb433bec71445c770fb3f7a401b3e4
[openmp] Accept directory for libomptarget-bc-path

The commandline flag to specify a particular openmp devicertl library
currently errors like:
```
fatal error: cannot open file
      './runtimes/runtimes-bins/openmp/libomptarget':
      Is a directory
```
CommonArgs successfully appends the directory to the commandline args then
mlink-builtin-bitcode rejects it.

This patch is a point fix to that. If --libomptarget-amdgcn-bc-path=directory
then append the expected name for the current architecture and go on as before.
This is useful for test runners that don't hardcode the architecture.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109057
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/openmp-offload-gpu.c