commit 47c4faf7188d035bd7d9bc78f84ab6aad62f0f44
parent a7937382cf85537e6cc7fe5a5f810121c1df3163
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 5 Oct 2021 14:16:42 +0200
all: update type IDs
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
6 files changed, 48 insertions(+), 51 deletions(-)
diff --git a/hare/types/+test.ha b/hare/types/+test.ha
@@ -328,6 +328,6 @@ fn resolve(
let t = htype.repr as tagged;
assert(len(t) == 3);
assert(t[0].repr as builtin == builtin::INT);
- assert(t[1].repr as builtin == builtin::STR);
- assert(t[2].repr as builtin == builtin::VOID);
+ assert(t[1].repr as builtin == builtin::VOID);
+ assert(t[2].repr as builtin == builtin::STR);
};
diff --git a/hare/types/hash.ha b/hare/types/hash.ha
@@ -169,7 +169,7 @@ export fn hash(t: *_type) u32 = {
flags = flags::NONE,
repr = builtin::STR,
};
- assert(hash(&sample) == 2206074632);
+ assert(hash(&sample) == 2843771249);
let sample = _type {
flags = flags::NONE,
@@ -178,7 +178,7 @@ export fn hash(t: *_type) u32 = {
...
},
};
- assert(hash(&sample) == 1488828140);
+ assert(hash(&sample) == 385303307);
let sample = _type {
flags = flags::ERROR,
@@ -187,13 +187,13 @@ export fn hash(t: *_type) u32 = {
...
},
};
- assert(hash(&sample) == 4003927486);
+ assert(hash(&sample) == 4117101293);
let _int = _type {
flags = flags::NONE,
repr = builtin::INT,
};
- assert(hash(&_int) == 461893804);
+ assert(hash(&_int) == 1099590421);
let sample = _type {
flags = flags::NONE,
@@ -202,7 +202,7 @@ export fn hash(t: *_type) u32 = {
flags = pointer_flags::NONE,
},
};
- assert(hash(&sample) == 934607058);
+ assert(hash(&sample) == 2081672869);
let sample = _type {
flags = flags::NONE,
@@ -211,7 +211,7 @@ export fn hash(t: *_type) u32 = {
flags = pointer_flags::NULLABLE,
},
};
- assert(hash(&sample) == 241140837);
+ assert(hash(&sample) == 841481858);
let sample = _type {
flags = flags::NONE,
@@ -231,7 +231,7 @@ export fn hash(t: *_type) u32 = {
],
},
};
- assert(hash(&sample) == 381928193);
+ assert(hash(&sample) == 2453524063);
let sample = _type {
flags = flags::NONE,
@@ -250,7 +250,7 @@ export fn hash(t: *_type) u32 = {
},
],
};
- assert(hash(&sample) == 1705302210);
+ assert(hash(&sample) == 2230759349);
let sample = _type {
flags = flags::NONE,
@@ -259,7 +259,7 @@ export fn hash(t: *_type) u32 = {
member = &_int,
},
};
- assert(hash(&sample) == 164621237);
+ assert(hash(&sample) == 3903522747);
let _uint = _type {
flags = flags::NONE,
@@ -278,7 +278,7 @@ export fn hash(t: *_type) u32 = {
&_void,
]: tagged,
};
- assert(hash(&sample) == 204212843);
+ assert(hash(&sample) == 2847927164);
let sample = _type {
flags = flags::NONE,
@@ -291,7 +291,7 @@ export fn hash(t: *_type) u32 = {
],
},
};
- assert(hash(&sample) == 2700673451);
+ assert(hash(&sample) == 94471087);
let sample = _type {
flags = flags::NONE,
@@ -302,11 +302,11 @@ export fn hash(t: *_type) u32 = {
params = [&_uint, &_int],
},
};
- assert(hash(&sample) == 3530404333);
+ assert(hash(&sample) == 1223530078);
let sample = _type {
flags = flags::NONE,
repr = &_void: slice,
};
- assert(hash(&sample) == 296987721);
+ assert(hash(&sample) == 263911532);
};
diff --git a/rt/types.ha b/rt/types.ha
@@ -97,51 +97,51 @@ export const @hidden builtin_char: types::typeinfo = types::typeinfo {
sz = 1, al = 1, flags = 0,
repr = types::builtin::CHAR,
}, @hidden builtin_f32: types::typeinfo = types::typeinfo {
- id = 930681398,
+ id = 1568378015,
sz = 4, al = 4, flags = 0,
repr = types::builtin::F32,
}, @hidden builtin_f64: types::typeinfo = types::typeinfo {
- id = 2037165609,
+ id = 930681398,
sz = 8, al = 8, flags = 0,
repr = types::builtin::F64,
}, @hidden builtin_i8: types::typeinfo = types::typeinfo {
- id = 461893804,
+ id = 2674862226,
sz = 1, al = 1, flags = 0,
repr = types::builtin::I8,
}, @hidden builtin_i16: types::typeinfo = types::typeinfo {
- id = 3312558843,
+ id = 2037165609,
sz = 2, al = 2, flags = 0,
repr = types::builtin::I16,
}, @hidden builtin_i32: types::typeinfo = types::typeinfo {
- id = 2674862226,
+ id = 1399468992,
sz = 4, al = 4, flags = 0,
repr = types::builtin::I32,
}, @hidden builtin_i64: types::typeinfo = types::typeinfo {
- id = 1099590421,
+ id = 3312558843,
sz = 8, al = 8, flags = 0,
repr = types::builtin::I64,
}, @hidden builtin_rune: types::typeinfo = types::typeinfo {
- id = 2206074632,
+ id = 2374983655,
sz = 4, al = 4, flags = 0,
repr = types::builtin::RUNE,
}, @hidden builtin_u8: types::typeinfo = types::typeinfo {
- id = 3181589295,
+ id = 1906196061,
sz = 1, al = 1, flags = 0,
repr = types::builtin::U8,
}, @hidden builtin_u16: types::typeinfo = types::typeinfo {
- id = 3481467866,
+ id = 2206074632,
sz = 2, al = 2, flags = 0,
repr = types::builtin::U16,
}, @hidden builtin_u32: types::typeinfo = types::typeinfo {
- id = 1906196061,
+ id = 4119164483,
sz = 4, al = 4, flags = 0,
repr = types::builtin::U32,
}, @hidden builtin_u64: types::typeinfo = types::typeinfo {
- id = 1268499444,
+ id = 3481467866,
sz = 8, al = 8, flags = 0,
repr = types::builtin::U64,
}, @hidden builtin_void: types::typeinfo = types::typeinfo {
- id = 3012680272,
+ id = 2543892678,
sz = 0, al = 0, flags = 0,
repr = types::builtin::VOID,
};
diff --git a/rt/types_arch+aarch64.ha b/rt/types_arch+aarch64.ha
@@ -1,9 +1,9 @@
export const @hidden builtin_int: types::typeinfo = types::typeinfo {
- id = 1737287038,
+ id = 1099590421,
sz = 4, al = 4, flags = 0,
repr = types::builtin::INT,
}, @hidden builtin_uint: types::typeinfo = types::typeinfo {
- id = 2543892678,
+ id = 1268499444,
sz = 4, al = 4, flags = 0,
repr = types::builtin::UINT,
}, @hidden builtin_bool: types::typeinfo = types::typeinfo {
@@ -11,24 +11,23 @@ export const @hidden builtin_int: types::typeinfo = types::typeinfo {
sz = 4, al = 4, flags = 0,
repr = types::builtin::BOOL,
}, @hidden builtin_size: types::typeinfo = types::typeinfo {
- id = 4119164483,
+ id = 1737287038,
sz = 8, al = 8, flags = 0,
repr = types::builtin::SIZE,
}, @hidden builtin_uintptr: types::typeinfo = types::typeinfo {
- id = 3650376889,
+ id = 3181589295,
sz = 8, al = 8, flags = 0,
repr = types::builtin::UINTPTR,
}, @hidden builtin_str: types::typeinfo = types::typeinfo {
- id = 3350498318,
+ id = 2843771249,
sz = 24, al = 8, flags = 0,
repr = types::builtin::STR,
}, @hidden builtin_null: types::typeinfo = types::typeinfo {
- id = 2843771249,
+ id = 461893804,
sz = 8, al = 8, flags = 0,
repr = types::builtin::NULL,
}, @hidden builtin_type: types::typeinfo = types::typeinfo {
- // TODO: This type ID is wrong
- id = 3181589295,
+ id = 3650376889,
sz = 8, al = 8, flags = 0,
repr = types::builtin::TYPE,
};
diff --git a/rt/types_arch+riscv64.ha b/rt/types_arch+riscv64.ha
@@ -1,9 +1,9 @@
export const @hidden builtin_int: types::typeinfo = types::typeinfo {
- id = 1737287038,
+ id = 1099590421,
sz = 4, al = 4, flags = 0,
repr = types::builtin::INT,
}, @hidden builtin_uint: types::typeinfo = types::typeinfo {
- id = 2543892678,
+ id = 1268499444,
sz = 4, al = 4, flags = 0,
repr = types::builtin::UINT,
}, @hidden builtin_bool: types::typeinfo = types::typeinfo {
@@ -11,24 +11,23 @@ export const @hidden builtin_int: types::typeinfo = types::typeinfo {
sz = 4, al = 4, flags = 0,
repr = types::builtin::BOOL,
}, @hidden builtin_size: types::typeinfo = types::typeinfo {
- id = 4119164483,
+ id = 1737287038,
sz = 8, al = 8, flags = 0,
repr = types::builtin::SIZE,
}, @hidden builtin_uintptr: types::typeinfo = types::typeinfo {
- id = 3650376889,
+ id = 3181589295,
sz = 8, al = 8, flags = 0,
repr = types::builtin::UINTPTR,
}, @hidden builtin_str: types::typeinfo = types::typeinfo {
- id = 3350498318,
+ id = 2843771249,
sz = 24, al = 8, flags = 0,
repr = types::builtin::STR,
}, @hidden builtin_null: types::typeinfo = types::typeinfo {
- id = 2843771249,
+ id = 461893804,
sz = 8, al = 8, flags = 0,
repr = types::builtin::NULL,
}, @hidden builtin_type: types::typeinfo = types::typeinfo {
- // TODO: This type ID is wrong
- id = 3181589295,
+ id = 3650376889,
sz = 8, al = 8, flags = 0,
repr = types::builtin::TYPE,
};
diff --git a/rt/types_arch+x86_64.ha b/rt/types_arch+x86_64.ha
@@ -1,9 +1,9 @@
export const @hidden builtin_int: types::typeinfo = types::typeinfo {
- id = 1737287038,
+ id = 1099590421,
sz = 4, al = 4, flags = 0,
repr = types::builtin::INT,
}, @hidden builtin_uint: types::typeinfo = types::typeinfo {
- id = 2543892678,
+ id = 1268499444,
sz = 4, al = 4, flags = 0,
repr = types::builtin::UINT,
}, @hidden builtin_bool: types::typeinfo = types::typeinfo {
@@ -11,24 +11,23 @@ export const @hidden builtin_int: types::typeinfo = types::typeinfo {
sz = 4, al = 4, flags = 0,
repr = types::builtin::BOOL,
}, @hidden builtin_size: types::typeinfo = types::typeinfo {
- id = 4119164483,
+ id = 1737287038,
sz = 8, al = 8, flags = 0,
repr = types::builtin::SIZE,
}, @hidden builtin_uintptr: types::typeinfo = types::typeinfo {
- id = 3650376889,
+ id = 3181589295,
sz = 8, al = 8, flags = 0,
repr = types::builtin::UINTPTR,
}, @hidden builtin_str: types::typeinfo = types::typeinfo {
- id = 3350498318,
+ id = 2843771249,
sz = 24, al = 8, flags = 0,
repr = types::builtin::STR,
}, @hidden builtin_null: types::typeinfo = types::typeinfo {
- id = 2843771249,
+ id = 461893804,
sz = 8, al = 8, flags = 0,
repr = types::builtin::NULL,
}, @hidden builtin_type: types::typeinfo = types::typeinfo {
- // TODO: This type ID is wrong
- id = 3181589295,
+ id = 3650376889,
sz = 8, al = 8, flags = 0,
repr = types::builtin::TYPE,
};