From afd2f7e9919737e30f9fae2d3cff892189301a55 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 1 Jun 2022 15:28:34 -0400 Subject: [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 --- llvm/lib/Object/Object.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Object/Object.cpp') diff --git a/llvm/lib/Object/Object.cpp b/llvm/lib/Object/Object.cpp index 576eb8d..d5e6716 100644 --- a/llvm/lib/Object/Object.cpp +++ b/llvm/lib/Object/Object.cpp @@ -120,6 +120,8 @@ LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR) { return LLVMBinaryTypeMachO64L; case ID_MachO64B: return LLVMBinaryTypeMachO64B; + case ID_Offload: + return LLVMBinaryTypeOffload; case ID_Wasm: return LLVMBinaryTypeWasm; case ID_StartObjects: -- cgit v1.1