Displaying 2 results from an estimated 2 matches for "_gracefully_".
2003 Dec 19
2
[LLVMdev] Union Type
...y
a previous write of an integer into the array. Yes, I know, I should
have chosen the pointer type as the basis for the array .. but then, it
wouldn't work reliably on an 8086 with segmented memory model :)
While various tests for word sizes and alignment rules could be used,
this problem is _gracefully_ handled by unions. To rewrite the example
above we would use something like:
%a_union = union { int, char* };
%foo = global [ 10 x %a_union ];
void %func() {
%int_ptr = getelementptr [10 x %a_union]* %foo,
long 0, long 0, ubyte 0;
%int_val = load int* %int_ptr;
%char_ptr =...
2003 Dec 19
0
[LLVMdev] Union Type
...h 64 bit integer types: just take up two slots. Is there
anything wrong with this approach? Using a union for the stacker stack on
a 64-bit machine would waste a ton of space when integers are pushed.
> While various tests for word sizes and alignment rules could be used,
> this problem is _gracefully_ handled by unions. To rewrite the example
The problem with adding unions is that it would require modifying _all of
the LLVM code_ that looks at the type-system, and it doesn't seem like it
gives us anything fundamentally new (like a vector type would). Also,
forcing the front-end to generat...