Displaying 2 results from an estimated 2 matches for "opt_33".
2009 Jun 13
4
[LLVMdev] ML types in LLVM
...s the object to the garbage
collector. However, pointers to the objects point past the header and
at the actual object. Sometimes, however, the program itself accesses
the header. For example, to determine the length of an array (the
length is in the header). For every type I output it like this:
%opt_33 = { i32, %opt_45*, float }
I could also create another type which includes the header something like:
%opt_33_with_header = {i32, %opt_33 }
Is there any way to express that a pointer is actually a pointer to an
interior element of a type? Something like %opt_33_in_heap =
%opt_33_with_header:1 ?...
2009 Jun 13
0
[LLVMdev] ML types in LLVM
...at won't work. What you can do is abuse address
spaces, giving every distinct type its own address space and casting
back and forth between address spaces as necessary.
> Is there any way to express that a pointer is actually a pointer to an
> interior element of a type? Something like %opt_33_in_heap =
> %opt_33_with_header:1 ?
Something like an ungetelementptr? No, sorry. That would be a
pretty nice extension, though obviously unsound, of course.
> Currently when I want to read the header of an %opt_33, I cast it to a
> i32* and then use getelementptr -1. Is there a better...