Commit Graph

500 Commits

Author SHA1 Message Date
gingerBill
342761e83a Refactor record polymorphic params code for unification 2021-03-27 17:21:12 +00:00
gingerBill
1e587d6635 Fix #883 - polymorphic specialization with target types of enumerated arrays 2021-03-27 15:22:05 +00:00
gingerBill
7028797d53 Implement soa_unzip 2021-03-24 19:29:25 +00:00
gingerBill
6c9d3715d8 Add type hinting to soa_zip 2021-03-24 18:08:34 +00:00
gingerBill
989a03dc77 soa_zip (-llvm-api only): creates an #soa[]struct from passed slices
x := []i32{1, 3, 9};
y := []f32{2, 4, 16};
z := []b32{true, false, true};

s_anonymous := soa_zip(x, y, z);
assert(s_anonymous[0]._1 == 2);

s_named := soa_zip(a=x, b=y, c=z);
assert(s_anonymous[0].b == 2);
2021-03-24 17:33:05 +00:00
gingerBill
fc1a352285 For bit_set, allow + and - to be aliases for | and &~, respectively 2021-03-23 23:34:01 +00:00
gingerBill
082381284c Remove dead code 2021-03-23 23:23:40 +00:00
gingerBill
3ff7bded64 Add intrinsics.volatile_store and intrinsics.volatile_load 2021-03-09 11:40:36 +00:00
gingerBill
15dbc99cb9 Minimize TokenPos size by using i32 for line/column/offset and file_id instead of String
To make `i32` safe, the parser limits the file size of odin files to a maximum of 2GiB (which will be good enough for the vast vast majority of cases)
2021-03-04 16:45:30 +00:00
gingerBill
75f127af7c Add -vet-extra (checks for unneeded casts and transmutes) 2021-03-03 14:17:48 +00:00
gingerBill
667aa3671e Fix Addressing for SOA on store; Add intrinsics.type_struct_field_count(T) 2021-03-01 17:54:49 +00:00
gingerBill
54194af71c Fix patch (yeah... I know) 2021-02-26 15:29:10 +00:00
gingerBill
575c7ff031 Patch issue with minimum dependency system and how it interacts with para poly procedures 2021-02-26 15:09:32 +00:00
gingerBill
8f9111e552 Build tag to make all declarations within a file private to the package //+private 2021-02-23 20:40:48 +00:00
gingerBill
41b854f192 Remove #opaque types 2021-02-23 15:45:06 +00:00
gingerBill
28f279329d Remove bit_field keyword and parsing logic 2021-02-23 15:29:54 +00:00
gingerBill
28ed310f31 Remove "pure" and "pure_none" calling conventions 2021-02-23 13:10:23 +00:00
gingerBill
efdee0dafb Remove bit_field type from Odin (keyword and dead runtime code still exists) 2021-02-19 11:31:14 +00:00
gingerBill
e64eb74eef Fix #831 2021-01-27 15:27:38 +00:00
gingerBill
720f2c7c61 Allow check_expr_with_type_hint to allow assignment of types to typeid without requiring typeid_of 2020-12-17 14:23:45 +00:00
gingerBill
416051f17b Fix #811 2020-12-14 16:39:31 +00:00
gingerBill
d7a5767aa3 If ir_type_requires_mem_zero is stored with zero, don't store again with the zeroinitializer 2020-12-08 15:43:57 +00:00
gingerBill
05a3bdad58 Allow nested procedures to access @(static) and @(thread_local) variables 2020-12-04 11:28:14 +00:00
gingerBill
047586afc6 Change ExactValue layout for complex/quaternion types to minimize its size 2020-12-03 14:21:33 +00:00
gingerBill
996c854071 Disable lb_const_hash for the time being 2020-12-02 11:48:50 +00:00
gingerBill
97c66c9c73 Add intrinsics.type_hasher_proc; Make map work with generic hasher procedure 2020-11-29 15:27:53 +00:00
gingerBill
39bed567b3 Add intrinsics.type_equal_proc; Make map use an internal equal procedure to compare keys 2020-11-29 14:22:42 +00:00
Dan Bechard
2d878de84d Update check_expr.cpp
Fixed typo in error message `procedure all` -> `procedure call`
2020-11-20 15:43:51 -08:00
gingerBill
260e28c0af Fix casting of untyped strings 2020-11-20 16:30:34 +00:00
gingerBill
63e4a2341f Support string literals for fixed arrays of runes; Add %q support for arrays/slices of bytes 2020-11-20 16:24:23 +00:00
gingerBill
6416a6f39c Allow string literals for [N]byte 2020-11-20 16:01:59 +00:00
gingerBill
aa5cb7f6a9 Fix proc type printing 2020-11-17 15:54:22 +00:00
gingerBill
d90fc18bef Basic odin doc support 2020-11-17 15:05:16 +00:00
gingerBill
ca4b0527e8 Minimize memory usage for AST nodes by using Slice<T> rather than Array<T> when the parameter doesn't need to grow 2020-11-16 15:18:25 +00:00
gingerBill
939878df50 Improve logic for x->y() shorthand 2020-11-15 23:54:18 +00:00
gingerBill
0d6f5cec37 Implement custom temporary allocator using ring buffer 2020-11-15 19:36:37 +00:00
gingerBill
17ec3e72a6 Add SCOPED_TEMPORARY_BLOCK for temporary allocations within a block 2020-11-15 18:45:40 +00:00
gingerBill
30d922b059 Make set_procedure_abi_types use the permanent_allocator 2020-11-15 18:11:49 +00:00
gingerBill
ee3b3fe6a3 Fix typeid_of bug 2020-11-10 14:48:57 +00:00
gingerBill
31f4590f4b Fix default parameters on record types 2020-11-09 13:04:36 +00:00
gingerBill
4629754f7c Inline asm expression (-llvm-api)
See https://llvm.org/docs/LangRef.html#inline-assembler-expressions
Example:
```
x := asm(i32) -> i32 {
    "bswap $0",
    "=r,r",
}(123);
```
Allowed directives `#side_effect`, `#align_stack`, `#att`, `#intel` e.g. `asm() #side_effect #intel {...}`
2020-10-24 16:32:37 +01:00
gingerBill
5a28a7e0f5 Add intrinsics.type_field_index_of 2020-10-15 16:12:47 +01:00
Joseph Battelle
3a3d415295 Fix issue #486
Use `check_is_assignable_to_using_subtype` in
`is_polymorphic_type_assignable`.

The polymorphic procedure in #486 can now also be written without the
cast:
```odin
print_entity :: proc(e : ^$E, p : proc(^$T) = print_base) { p(e); }
```
2020-09-16 12:32:57 -07:00
gingerBill
59d9821bd9 Add intrinsics.type_has_field 2020-09-16 20:08:45 +01:00
gingerBill
c1149dbdee Update math and math/linalg; add "pure_none" calling convention 2020-09-10 15:00:19 +01:00
gingerBill
74ed779616 Fix #702 2020-08-05 23:14:11 +01:00
gingerBill
d1d5f61230 Add intrinsics.alloca 2020-08-02 14:59:39 +01:00
gingerBill
7ae54ae3b4 Add -no-dynamic-literals to disallow dynamic array and map literals 2020-07-14 23:01:34 +01:00
gingerBill
86f1574f78 Fix #696 2020-07-14 16:43:23 +01:00
gingerBill
cb52f6986a Fix Addressing_OptionalOk selector expression rules for struct field variables 2020-07-08 23:39:49 +01:00