OSDN Git Service

[clang-offload-bundler] Add option -list
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 9 Dec 2020 15:35:12 +0000 (10:35 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 6 Jan 2021 21:23:01 +0000 (16:23 -0500)
commit90bf3ecef4bb1e214a718aebcee730c24199c8ba
tree7650812f4d0d77bc44c5a9bcf5c89214bfb7093c
parentf6f6f6375d1a4bced8a6e79a78726ab32b8dd879
[clang-offload-bundler] Add option -list

clang-offload-bundler is not only used by clang driver
to bundle/unbundle files for offloading toolchains,
but also used by out of tree tools to unbundle
fat binaries generated by clang. It is important
to be able to list the bundle IDs in a bundled
file so that the bundles can be extracted.

This patch adds an option -list to list bundle
ID's in a bundled file. Each bundle ID is separated
by new line. If the file is not a bundled file
nothing is output and returns 0.

Differential Revision: https://reviews.llvm.org/D92954
clang/test/Driver/clang-offload-bundler.c
clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp