diff options
Diffstat (limited to 'cparser/Machine.ml')
-rw-r--r-- | cparser/Machine.ml | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/cparser/Machine.ml b/cparser/Machine.ml index 21b3daa4..ffff5fbd 100644 --- a/cparser/Machine.ml +++ b/cparser/Machine.ml @@ -39,7 +39,8 @@ type t = { alignof_double: int; alignof_longdouble: int; alignof_void: int option; - alignof_fun: int option + alignof_fun: int option; + bitfields_msb_first: bool } let ilp32ll64 = { @@ -66,7 +67,8 @@ let ilp32ll64 = { alignof_double = 8; alignof_longdouble = 16; alignof_void = None; - alignof_fun = None + alignof_fun = None; + bitfields_msb_first = false } let i32lpll64 = { @@ -93,7 +95,8 @@ let i32lpll64 = { alignof_double = 8; alignof_longdouble = 16; alignof_void = None; - alignof_fun = None + alignof_fun = None; + bitfields_msb_first = false } let il32pll64 = { @@ -120,15 +123,26 @@ let il32pll64 = { alignof_double = 8; alignof_longdouble = 16; alignof_void = None; - alignof_fun = None + alignof_fun = None; + bitfields_msb_first = false } -let make_char_signed c = {c with char_signed = true} +(* Canned configurations for some ABIs *) + +let x86_32 = { ilp32ll64 with char_signed = true } +let x86_64 = { i32lpll64 with char_signed = true } +let win64 = { il32pll64 with char_signed = true } +let ppc_32_bigendian = { ilp32ll64 with bitfields_msb_first = true } +let arm_littleendian = ilp32ll64 + +(* Add GCC extensions re: sizeof and alignof *) let gcc_extensions c = { c with sizeof_void = Some 1; sizeof_fun = Some 1; alignof_void = Some 1; alignof_fun = Some 1 } +(* Default configuration *) + let config = ref (match Sys.word_size with | 32 -> ilp32ll64 |