[Binary] Promote OffloadBinary to inherit from Binary
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 1 Jun 2022 19:28:34 +0000 (15:28 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 1 Jun 2022 22:40:57 +0000 (18:40 -0400)
commitafd2f7e9919737e30f9fae2d3cff892189301a55
tree9f61b77fde3875f7e32a04ca52e622c9ff97744e
parent909a78b3a430f99518a04ae0bced8f0b9ba6e02a
[Binary] Promote OffloadBinary to inherit from Binary

We use the `OffloadBinary` to create binary images of offloading files
and their corresonding metadata. This patch changes this to inherit from
the base `Binary` class. This allows us to create and insepect these
more generically. This patch includes all the necessary glue to
implement this as a new binary format, along with added the magic bytes
we use to distinguish the offloading binary to the `file_magic`
implementation.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D126812
clang/lib/CodeGen/BackendUtil.cpp
llvm/include/llvm-c/Object.h
llvm/include/llvm/BinaryFormat/Magic.h
llvm/include/llvm/Object/Binary.h
llvm/include/llvm/Object/OffloadBinary.h
llvm/lib/BinaryFormat/Magic.cpp
llvm/lib/Object/Binary.cpp
llvm/lib/Object/Object.cpp
llvm/lib/Object/ObjectFile.cpp
llvm/lib/Object/OffloadBinary.cpp
llvm/unittests/Object/OffloadingTest.cpp