================
@@ -82,76 +116,79 @@ class OffloadBinary : public Binary {
LLVM_ABI static Expected<std::unique_ptr<OffloadBinary>>
create(MemoryBufferRef);
- /// Serialize the contents of \p File to a binary buffer to be read later.
- LLVM_ABI static SmallString<0> write(const OffloadingImage &);
+ /// Serialize the contents of \p OffloadingData to a binary buffer to be read
+ /// later.
+ LLVM_ABI static SmallString<0>
+ write(ArrayRef<OffloadingImage> OffloadingData);
static uint64_t getAlignment() { return 8; }
- ImageKind getImageKind() const { return TheEntry->TheImageKind; }
- OffloadKind getOffloadKind() const { return TheEntry->TheOffloadKind; }
+ ImageKind getOnlyImageKind() const {
+ assert(getEntriesCount() == 1 && "Expected exactly one entry.");
+ return Entries[0].first->TheImageKind;
+ }
+
+ OffloadKind getOffloadKind() const { return
Entries[0].first->TheOffloadKind; }
uint32_t getVersion() const { return TheHeader->Version; }
- uint32_t getFlags() const { return TheEntry->Flags; }
+ uint32_t getFlags() const { return Entries[0].first->Flags; }
----------------
jhuber6 wrote:
I don't think this has any users, we can and should change the interface
https://github.com/llvm/llvm-project/pull/169425
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits