JuliaLang/julia — pull request #2454 by pao (2013-03-03 22:46:20+00:00)
Title: RFC: Add function to obtain native type alignment information

This handles all the libLLVM machinery outside of the Julia context.

```
julia> i8a, i16a, i32a, i64a, f32a, f64a = zeros(Uint, 1), zeros(Uint, 1), zeros(Uint, 1), zeros(Uint, 1), zeros(
Uint, 1), zeros(Uint, 1)
([0x0000000000000000],[0x0000000000000000],[0x0000000000000000],[0x0000000000000000],[0x0000000000000000],[0x0000
000000000000])

julia> ccall("jl_native_alignment", Void, (Ptr{Uint}, Ptr{Uint}, Ptr{Uint}, Ptr{Uint}, Ptr{Uint}, Ptr{Uint}), i8a, i16a, i32a, i64a, f32a, f64a)

julia> i8a
1-element Uint64 Array:
0x0000000000000001

julia> i16a
1-element Uint64 Array:
0x0000000000000002

julia> i32a
1-element Uint64 Array:
0x0000000000000004

julia> i64a
1-element Uint64 Array:
0x0000000000000008

julia> f32a
1-element Uint64 Array:
0x0000000000000004

julia> f64a
1-element Uint64 Array:
0x0000000000000008
```

Please proceed to beat up my API.