[llvm-dev] How to store Values of any types inside an i8 array at compile time.

Alexandre B via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 28 08:55:49 PST 2021


An example of the subject would be storing a symbol (e.g. a function
pointer) inside the array next to, let's say, integers. This would allow
the linker to place the right address of the symbols, which we do not know
at optimization-time, in the `i8` array.

How can I store any LLVM Value, whichever it's type is (as long as it's
sized), inside an `[<Sum of sizes> x i8]` array ? This, storing Values of
any type inside an `[N x i8]` array, would take place in a LLVM pass. I am
aware that it will require to change every use of these values by a pointer
cast and a load; this isn't an issue.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211228/363d2123/attachment.html>


More information about the llvm-dev mailing list