[LLVMdev] variable sized structs in LLVM
Chris Lattner
sabre at nondot.org
Fri Jun 24 19:48:24 PDT 2005
On Fri, 24 Jun 2005, Aaron Gray wrote:
>> As you mention above, you should use malloc and cast the return value. If
>> you want to get the desired size in a target-independent way (always good),
>> you should do something like this:
...
> Chris you should maybe add this example to the getelementptr documentation.
This isn't really appropriate for the reference manual, but I added it to
the "Source Language Implementation Notes" of my web page here:
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
Hope this helps!
-Chris
--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/
More information about the llvm-dev
mailing list