Commit Graph

479 Commits

Author SHA1 Message Date
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
gingerBill
51e50d3e31 Add intrinsics.type_proc_parameter_type; Add intrinsics.type_proc_return_type 2020-07-01 22:35:38 +01:00
gingerBill
2b27300387 Fix LLVM code gen bug 2020-06-22 16:57:21 +01:00
gingerBill
01d12770fa Fix compound literals for constant procedure fields 2020-06-11 16:11:54 +01:00
gingerBill
57b09b2ffb Fix #439 2020-06-10 15:37:50 +01:00
gingerBill
e86fde3cb1 Fix #648 2020-06-10 15:09:04 +01:00
gingerBill
9b1cc6e94f Update logic for slice literals, backing array to be on the stack if possible (LLVM C API) 2020-06-08 12:41:42 +01:00
gingerBill
59a0bbb385 Improve termination rules checking for missing return; Make diverging procedure -> ! be terminators 2020-06-06 15:16:24 +01:00
gingerBill
8057af9e09 Fix #659 Compiler error when indexing constant slices 2020-05-31 12:20:47 +01:00
gingerBill
cbfbff7240 Add intrinsics.type_is_comparable; Add sort.linear_search 2020-05-23 14:02:21 +01:00
gingerBill
aa029fe8d9 Add "pure" procedure types 2020-05-23 13:38:06 +01:00
gingerBill
26fe9b0212 Fix SelectorCallExpr with no return values 2020-05-22 23:41:17 +01:00
gingerBill
7bd1039a49 Selector Call Expressions: x->y(123) == x.y(x, 123) 2020-05-22 14:54:30 +01:00
gingerBill
86b613fb15 Remove the need for type_of, size_of, align_of, offset_of to be keywords 2020-05-22 12:32:29 +01:00
gingerBill
e1bdaa981a Relative pointer and relative slices 2020-05-15 18:45:24 +01:00
gingerBill
ff92eb9112 Relative pointers 2020-05-15 17:37:00 +01:00
gingerBill
e0a242e9a1 Enforce explicit context definition for procedure calls 2020-05-14 13:44:28 +01:00
gingerBill
cd4403be0c Fix Assertion failure in ir_print_exact_value #620 2020-05-14 00:34:27 +01:00
gingerBill
f661d34049 Implement Explicit context creation #639 2020-05-14 00:13:26 +01:00
gingerBill
af1d4d6e72 Implement Allow .? operator to unwrap any union #549 2020-05-14 00:00:10 +01:00
gingerBill
c2bfb221f5 Fix #561 where statements that eval to false do not show incorrect usage location 2020-05-13 23:45:55 +01:00
gingerBill
7c42d4ba75 (#594) Add #config to replace #defined; Restrict #defined within procedure bodies to remove race condition 2020-05-13 23:29:06 +01:00