Commit Graph

223 Commits

Author SHA1 Message Date
gingerBill
b33bf3f704 Correct race condition and incorrect usage of condition_signal outside of a mutex lock 2021-08-26 22:17:51 +01:00
gingerBill
382ca20916 Correct procedure checking flag handling, and correct the (bodge) handle of unchecked procedure bodies 2021-08-23 19:24:53 +01:00
gingerBill
fe2ad54f60 Fix bug in check_is_terminating 2021-08-23 17:42:54 +01:00
gingerBill
cba0bd30f5 Add suggestions when trying to take the address the a value from a for/switch statement 2021-08-23 11:50:02 +01:00
gingerBill
35026000bb Fix deadlock caused by typo 2021-08-19 11:40:26 +01:00
gingerBill
e3fef2dade Improve parsing for or_return; allow #force_inline foo() or_return; 2021-08-16 11:58:50 +01:00
gingerBill
4c306a6f99 Correct or_return logic for debug printing and expression is not used checking 2021-08-16 11:08:37 +01:00
gingerBill
000bda8419 Reduce superfluous error messages for return statements expecting not-1 return values 2021-08-07 16:29:00 +01:00
gingerBill
ed5a4afc8c Temporarily disable -threaded-checker; Restructure the untyped-expr-info system to be much more thread-friendly 2021-07-13 15:54:56 +01:00
gingerBill
d9e6ade030 Add experimental support for a threaded semantic checker to -threaded-checker 2021-07-10 23:51:37 +01:00
gingerBill
4a932616fc Improve CheckerContext usage 2021-07-10 13:02:13 +01:00
gingerBill
3662275119 Allow x in ptr_to_map_or_bit_set 2021-07-10 11:18:19 +01:00
gingerBill
e8f2c5a48a [Experimental] Add 'try' and `or_else' built-in procedures 2021-07-04 01:38:43 +01:00
gingerBill
41f2539484 Improve logic for diverging procedures by checking if it terminates 2021-06-16 12:07:24 +01:00
gingerBill
8f57bb0799 Add unreachable detection for deferred statements in a scope which contains a diverging procedure call
```odin
{
    defer foo(); // Unreachable defer statement due to diverging procedure call at the end of the current scope
    os.exit(0);
}
```
2021-06-16 11:41:29 +01:00
gingerBill
b0e21bd616 Allow trivial optimizations for switch statements of typeid 2021-06-09 23:05:37 +01:00
gingerBill
599d18f26f Experimental support for inline swizzling for array types of len <= 4 e.g. v.xyz, v.argb, v.xxx 2021-06-05 17:22:39 +01:00
gingerBill
92abddddc5 Be a little more correct with the temporary Ast node 2021-05-19 15:02:36 +01:00
gingerBill
9c54ed5792 Add range-based error messages to -verbose-errors
Example:
Cannot convert '(1 + 2)' to 'untyped bool' from 'untyped integer'

	x := (1 + 2) * true;
	     ^~~~~~^
2021-05-19 14:15:57 +01:00
gingerBill
3ac934dd15 Add suggestion for unused expression on x == y
Expression is not used: 'x == 123'
	Suggestion: Did you mean to do an assignment?
	            'x = 123;'
2021-05-19 11:58:02 +01:00
gingerBill
6ef96d3300 Improve untyped to typed logic for aiding the backend 2021-05-16 14:44:02 +01:00
gingerBill
ce08e832f7 Allow ..= alongside .. as a "full range" operator; Update core:odin/parser etc 2021-05-16 12:34:35 +01:00
gingerBill
7b7081d607 Remove old dead code 2021-05-15 18:59:54 +01:00
gingerBill
be12f12c3c Fix #814 2021-05-13 00:57:10 +01:00
gingerBill
cb2e6ea31d Remove use_llvm_api related checks and other related things 2021-04-25 20:03:05 +01:00
gingerBill
c29b643a58 Move out some intrinsics into separate procedures in llvm_backend.cpp; Rename InlineRangeStmt to UnrollRangeStmt (eventually merge the two AST nodes) 2021-04-24 15:00:01 +01:00
gingerBill
47c7dc6a9b Add new intrinsics: debug_trap, trap, read_cycle_counter, expect 2021-04-22 10:35:17 +01:00
gingerBill
3612569624 Allow casting of #optional_ok call expressions 2021-04-19 15:46:12 +01:00
gingerBill
1aecd7f5ff Add support for soa slice reference iteration 2021-03-24 22:39:29 +00:00
gingerBill
5faf859a56 Support using on intermediate soa field value from a for-in statement 2021-03-24 22:34:55 +00:00
gingerBill
2ec3326653 Support #soa array iteration in a for in loop for -llvm-api backend only 2021-03-24 14:31:44 +00:00
gingerBill
d969d0b264 Make for in logic a bit more generic 2021-03-24 12:31:05 +00:00
gingerBill
0e3ecc350a Make the parser support as many identifiers on the LHS in for in loops to improve error messages 2021-03-24 12:11:00 +00:00
gingerBill
8123ff83a3 Fix is_diverging_stmt for invalid statements 2021-03-13 15:01:23 +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
a1693c0184 Deprecate inline for in favour of #unroll for 2021-02-23 14:45:15 +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
6c2b93d519 Improve text/scanner whitespace parameter to use a bit_set instead; Improve error message for for x in y where y is not iterable but allows in as an operator 2020-12-15 22:28:40 +00:00
gingerBill
828fe2ce56 Fix #795 2020-12-03 12:25:45 +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
4844dd4d96 Add check to block statements to see if they only contain one statement, a value declaration, and err. 2020-09-23 11:16:33 +01:00
Joseph Battelle
e9c598a426 Fix issue #723
Typo in `check_stmt_internal` for case Ast_UsingStmt; first element
was used for all elements of the enumerated list.
2020-09-14 16:41:53 -07:00
gingerBill
ccb7c3513b Fix check_arity_match bug 2020-09-12 15:50:42 +01:00
gingerBill
6158a49618 Make sync.atomic_* operations use when statements instead of switch; Make #panic diverging 2020-08-16 12:34:12 +01:00
gingerBill
2a684830f9 Fix using pointers bug with addressing struct fields 2020-06-18 17:50:54 +01:00
gingerBill
87a6d695d6 Fix typo in error message 2020-06-06 22:39:36 +01:00