[clang] [llvm] [Offloading] Extend OffloadBinary format to support multiple metadata entries (PR #169425)

Yury Plyakhin via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 3 14:47:35 PST 2026


================
@@ -916,15 +916,20 @@ class SYCLWrapper {
   std::pair<Constant *, Constant *>
   initOffloadEntriesPerImage(StringRef Entries, const Twine &OffloadKindTag) {
     SmallVector<Constant *> EntriesInits;
-    std::unique_ptr<MemoryBuffer> MB = MemoryBuffer::getMemBuffer(
-        Entries, /*BufferName*/ "", /*RequiresNullTerminator*/ false);
-    for (line_iterator LI(*MB); !LI.is_at_eof(); ++LI) {
-      GlobalVariable *GV =
-          emitOffloadingEntry(M, /*Kind*/ OffloadKind::OFK_SYCL,
-                              Constant::getNullValue(PointerType::getUnqual(C)),
-                              /*Name*/ *LI, /*Size*/ 0,
-                              /*Flags*/ 0, /*Data*/ 0);
+    const char *Current = Entries.data();
+    const char *End = Current + Entries.size();
+    while (Current < End) {
+      StringRef Name(Current);
----------------
YuriPlyakhin wrote:

updated loop a bit.

https://github.com/llvm/llvm-project/pull/169425


More information about the cfe-commits mailing list