@@ -801,13 +801,16 @@ struct SYCLWrapper {
801801 return ConstantExpr::getGetElementPtr (Var->getValueType (), Var, ZeroZero);
802802 }
803803
804- // / Creates a global variable that is initiazed with the given \p Entries.
804+ // / Each image contains its own set of symbols, which may contain different
805+ // / symbols than other images. This function constructs an array of
806+ // / symbol entries for a particular image.
805807 // /
806- // / \returns Pair of Constants that point at entries content .
808+ // / \returns Pointers to the beginning and end of the array .
807809 std::pair<Constant *, Constant *>
808- addOffloadEntriesToModule (StringRef Entries) {
810+ initOffloadEntriesPerImage (StringRef Entries) {
809811 SmallVector<Constant *> EntriesInits;
810- std::unique_ptr<MemoryBuffer> MB = MemoryBuffer::getMemBuffer (Entries);
812+ std::unique_ptr<MemoryBuffer> MB = MemoryBuffer::getMemBuffer (
813+ Entries, /* BufferName*/ " " , /* RequiresNullTerminator*/ false );
811814 for (line_iterator LI (*MB); !LI.is_at_eof (); ++LI) {
812815 Constant *C = addStringToModule (*LI, " __sycl_offload_entry_name" );
813816 GlobalVariable *GV =
@@ -887,7 +890,7 @@ struct SYCLWrapper {
887890
888891 // For SYCL images offload entries are defined here per image.
889892 std::pair<Constant *, Constant *> ImageEntriesPtrs =
890- addOffloadEntriesToModule (OI.StringData .lookup (" symbols" ));
893+ initOffloadEntriesPerImage (OI.StringData .lookup (" symbols" ));
891894 Constant *WrappedBinary = ConstantStruct::get (
892895 SyclDeviceImageTy, Version, OffloadKindConstant, ImageKindConstant,
893896 TripleConstant, CompileOptions, LinkOptions, Binary.first ,
0 commit comments