[Object] Refactor code for extracting offload binaries
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 25 Aug 2022 17:58:55 +0000 (12:58 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 6 Sep 2022 13:55:16 +0000 (08:55 -0500)
commit5dbc7cf7cac4428e0876a94a4fca10fe60af7328
tree5eb4ef0ea3898db7bc7b0f07645bbecc9e271178
parent42836e283fc58d5cebbcbb2e8eb7619d92fb9c2d
[Object] Refactor code for extracting offload binaries

We currently extract offload binaries inside of the linker wrapper.
Other tools may wish to do the same extraction operation. This patch
simply factors out this handling into the `OffloadBinary.h` interface.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D132689
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
llvm/include/llvm/Object/OffloadBinary.h
llvm/lib/Object/CMakeLists.txt
llvm/lib/Object/OffloadBinary.cpp