[clang-offload-bundler] Standardize TargetID field for bundler
authorJacob Lambert <jacob.lambert@amd.com>
Fri, 10 Mar 2023 08:47:50 +0000 (00:47 -0800)
committerJacob Lambert <jacob.lambert@amd.com>
Tue, 14 Mar 2023 21:12:31 +0000 (14:12 -0700)
commite48ae0dbd80d58ce8eded9e55f0b1262d52517af
treeb4d93a50dd7d2f625a297ea7e6ed6e4936243103
parentc361741a271db0330f17dbebec18dcb4779a6252
[clang-offload-bundler] Standardize TargetID field for bundler

The bundler accepts both of the following for the --target option:
  hip-amdgcn-amd-amdhsa-gfx900    (no env field)
  hip-amdgcn-amd-amdhsa--gfx900   (blank env field)

The environment field is defined as optional for Triples
in Triple.h. However, in this patch we update the bundler to
internally standardize to include the env field. While users
aren't required to specify an env field when listing targets on
the commandline, bundles generated by the offload-bundler will
include the ABI field.

This standardization simplifies things for APIs that deal with
bundles generated by the clang-offload-bundler tool.

Differential Revision: https://reviews.llvm.org/D145770
clang/docs/ClangOffloadBundler.rst
clang/lib/Driver/OffloadBundler.cpp
clang/test/Driver/clang-offload-bundler-asserts-on.c
clang/test/Driver/clang-offload-bundler-standardize.c [new file with mode: 0644]
clang/test/Driver/clang-offload-bundler.c
clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp