[llvm] [llvm-c] Add `LLVMConstDataArray` and `LLVMGetRawDataValues` (PR #129440)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 00:32:09 PDT 2025


================
@@ -2388,6 +2398,19 @@ LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
 LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
                              uint64_t Length);
 
+/**
+ * Create a ConstantDataArray from raw values.
+ *
+ * ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double.
+ * Data points to a contiguous buffer of raw values with the appropriate
+ * endianness. The element count is inferred from the element type and the data
----------------
nikic wrote:

"appropriate endianness" could benefit from being more specific. The data must be in host endianness, right?

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


More information about the llvm-commits mailing list