You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constructors for ConstantStruct and multidimensional ConstantArrays
Nested structs are currently not supported via the `ConstantStruct(value, packed::Core.Bool=false)`, `ConstantStruct(value, ctx::Context=GlobalContext(), packed::Core.Bool=false)`
and `ConstantStruct(value, typ::LLVMType)` constructors. After some testing and looking at the generated LLVM IR of some C code using nested structs, it appears
like nested structs need to be named. This is an issue because we can't know the LLVM name of a nested struct type via a Julia value. Of course we could define our own struct
types for nested structs, but this leads to other issues like making sure the name does not clash, and duplicated definitions of the same struct (e.g. when calling `ConstStruct`
multiple times with the same struct value). Nested structs can still be created via the "lower-level" constructors if necessary.
As for multidimensional arrays: it doesn't seem to be possible to read from them via `LLVMGetElementAsConstant`, so this is not supported.
0 commit comments