================ @@ -159,6 +160,107 @@ namespace intel { /// the Intel runtime offload plugin. Error containerizeOpenMPSPIRVImage(std::unique_ptr<MemoryBuffer> &Binary); } // namespace intel + +namespace sycl { +class PropertySetRegistry; + +// A property value. It can be either a 32-bit unsigned integer or a byte array. +class PropertyValue { +public: + using ByteArrayTy = SmallVector<char, 8>; + + PropertyValue() = default; + PropertyValue(uint32_t Val) : Value(Val) {} + PropertyValue(StringRef Data) + : Value(ByteArrayTy(Data.begin(), Data.end())) {} + + template <typename C, typename T = typename C::value_type> + PropertyValue(const C &Data) + : PropertyValue({reinterpret_cast<const char *>(Data.data()), + Data.size() * sizeof(T)}) {} ---------------- jzc wrote:
I've simplified the byte array code compared to the downstream code, but they won't compatible downstream and would cause ABI-break and runtime changes. The downstream implementation always wrote the number of bits the data uses in the first 8 bytes of a byte-array property value, but after some tests, I found this values way never used, except for one place that could be worked around. https://github.com/intel/llvm/blob/a9db58476ab1e1ff87f128088ac203539d87d22b/llvm/lib/Support/PropertySetIO.cpp#L153-L169 https://github.com/llvm/llvm-project/pull/136697 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits