Marc Tiehuis
353419f82d
Default to strict IEEE floating point
...
Closes #1227 .
2018-08-23 22:54:46 +12:00
Andrew Kelley
4b68ef45af
fix incorrectly generating an unused const fn global
...
closes #1277
2018-08-22 14:31:30 -04:00
Andrew Kelley
5aeb3217ee
fixup for previous commit
2018-08-22 14:24:48 -04:00
Raul Leal
87b10400c2
allow implicit cast from *[N]T to ?[*]T ( #1398 )
...
* allow implicit cast from *[N]T to ?[*]T
2018-08-22 13:12:08 -04:00
Andrew Kelley
b2917e6be0
Revert "Merge branch 'mtn-translate-c-enum-vals'"
...
This reverts commit 937b822fa90181bf59f1c2ac45faab09342a183f, reversing
changes made to dd4b13ac0326aeb6c2c197bfac49f9e931ccee37.
Tests failing on Windows.
Re-opens #1360
2018-08-21 20:50:03 -04:00
kristopher tate
b023db2e82
src/translate_c.cpp: correctly bridge llvm::APSInt with Zig BigInt;
...
ACHTUNG: llvm::APSInt stores an int's sign inside of its getRawData; Internally to Zig we store an integer's sign outside of getRawData! (~aps_int) calls .flip() internally on the raw data to match Zig.
test/translate_c.zig: enum: add wider range of values (u64) to try;
2018-08-20 22:46:11 -04:00
Michael Noronha
7e7e59d881
translate-c: Correctly translate enum init values, addressing #1360
2018-08-20 22:45:19 -04:00
Andrew Kelley
dd4b13ac03
Revert "translate-c: Correctly translate enum init values, addressing #1360 ( #1377 )"
...
This reverts commit b8ce8f219c48ae833199130ce575241f848d690b.
Squashing the commits from the pull request resulted in kristopher tate
from being omitted from the authors. A future commit will merge
the code correctly.
2018-08-20 22:39:39 -04:00
Michael Noronha
b8ce8f219c
translate-c: Correctly translate enum init values, addressing #1360 ( #1377 )
...
* translate-c: Correctly translate enum init values
* translate-c: Test enum initialization
* translate-c: Flip to positive using APSInt builtins
* src/translate_c.cpp: correctly bridge llvm::APSInt with Zig BigInt;
ACHTUNG: llvm::APSInt stores an int's sign inside of its getRawData; Internally to Zig we store an integer's sign outside of getRawData! (~aps_int) calls .flip() internally on the raw data to match Zig.
* test/translate_c.zig: enum: add wider range of values (u64) to try;
closes #1360
2018-08-20 14:29:26 -04:00
Wink Saville
d927f347de
Fix ir_analyze_instruction_atomic_rmw ( #1351 )
...
There were two tests of type_is_valid(casted_ptr->value.type) change the
second one to type_is_valie(casted_operand->value.type).
2018-08-07 23:18:26 -04:00
Andrew Kelley
63a23e848a
translate-c: fix for loops with var init and empty body
2018-08-05 18:40:14 -04:00
Andrew Kelley
387fab60a6
translate-c: fix do while with empty body
2018-08-05 18:32:38 -04:00
Andrew Kelley
c420b234cc
translate-c: handle for loop with empty body
2018-08-05 18:18:24 -04:00
Andrew Kelley
aa232089f2
translate-c: fix while loop with no body
2018-08-05 18:06:39 -04:00
Andrew Kelley
9bd8b01650
fix tagged union initialization with a runtime void
...
closes #1328
2018-08-03 15:21:08 -04:00
kristopher tate
298abbcff8
better support for _ identifier
...
* disallow variable declaration of `_`
* prevent `_` from shadowing itself
* prevent read access of `_`
closes #1204
closes #1320
2018-08-03 02:57:17 -04:00
Andrew Kelley
895f262a55
pull request fixups
...
* clean up parser code
* fix stage2 parse and render code
* remove redundant test
* make stage1 compile tests leaner
2018-08-02 14:15:31 -04:00
kristopher tate
5de92425d5
src/parser.cpp: fix typo from rebase;
2018-08-02 17:11:37 +09:00
kristopher tate
d3f628907a
src/parser.cpp: remove promise_symbol from suspend;
...
Tracking Issue #1296 ;
2018-08-02 16:59:11 +09:00
kristopher tate
b3cd65d56e
src/ir.cpp: remove promise_symbol from suspend;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
5e5685c117
src/ast_render.cpp: remove promise_symbol from suspend;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
ca1b356337
src/all_types.hpp: remove promise_symbol from suspend;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
92cb330e16
src/codegen.cpp: @handle(): replace hacky ref chain with llvm intrinsic;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
104bdb03d6
src/codegen.cpp: return promise instead of null promise;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
a8ea236095
src/ir.cpp: don't allow @handle() outside of a function;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
fcf53b31fc
src/ir.cpp: return promise->T instead of promise;
...
Tracking Issue #1296 ;
Thanks @andrewrk ;
2018-08-02 16:50:08 +09:00
kristopher tate
c1a3b0cb0a
src/ir.cpp: add/throw error for @handle() in a non async context;
...
Tracking Issue #1296 ;
Thanks @andrewrk ;
2018-08-02 16:50:08 +09:00
kristopher tate
db362bec18
src/codegen.cpp: reassert that there are no generated errors in codegen;
...
Tracking Issue #1296 ;
Thanks @andrewrk ;
2018-08-02 16:50:08 +09:00
kristopher tate
0ee6502562
src/codegen.cpp: remove add_node_error from ir_render_handle;
...
Tracking Issue #1296 ;
Thanks @andrewrk ;
2018-08-02 16:50:08 +09:00
kristopher tate
81f463626a
src/codegen.cpp: add/throw error for @handle() in a non async context;
...
Tracking Issue #1296 ;
I removed/commented-out the assert checking for no errors since we now have some errors rendered.
2018-08-02 16:50:08 +09:00
kristopher tate
a2e5691228
src/codegen.cpp: return null if calling convention is not async;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
da5f3d5c4c
src/ir_print.cpp: support @handle();
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
cd18186715
src/codegen.cpp: base handle builtin on @frameAddress();
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
a9ea22d4f9
src/ir.cpp: wire-up IR for handle builtin;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
kristopher tate
e79c913cbc
src/all_types.hpp: add enums for Handle Builtin;
...
Tracking Issue #1296 ;
2018-08-02 16:50:08 +09:00
Andrew Kelley
6fd6bc94f5
await sets suspend bit; return clears suspend bit
2018-07-30 12:22:54 -04:00
Andrew Kelley
09304aab77
fix cancel and await semantics
2018-07-29 23:25:40 -04:00
Andrew Kelley
0d79e03816
canceling an await also cancels things awaiting it
2018-07-28 13:52:48 -04:00
Andrew Kelley
dd272d1316
await cancels the await target when it is canceled
2018-07-28 12:36:02 -04:00
Andrew Kelley
0ba2bc38d7
await checks the cancel bit
2018-07-28 12:23:47 -04:00
Andrew Kelley
60cda3713f
suspend cancels awaiter when it gets canceled
2018-07-28 12:11:39 -04:00
Andrew Kelley
c6f9a4c044
cancel detects suspend bit
2018-07-28 01:26:11 -04:00
Andrew Kelley
6fed777637
cancel detects if the target handle has already returned
2018-07-28 01:22:51 -04:00
Andrew Kelley
f0c049d02b
detect double await
2018-07-27 18:37:30 -04:00
Andrew Kelley
e5beca886d
suspend checks the cancel bit
2018-07-27 18:07:30 -04:00
Andrew Kelley
e491c38189
resume detects resuming when not suspended
2018-07-27 18:01:39 -04:00
Andrew Kelley
341bd0dfa4
await sets the await bit
2018-07-27 17:47:27 -04:00
Andrew Kelley
0b7a9c0722
cancel sets the cancel bit
2018-07-27 17:42:09 -04:00
Andrew Kelley
02c5bda704
remove ability to break from suspend blocks
...
closes #803
2018-07-27 17:27:03 -04:00
Andrew Kelley
442e244b4d
suspend sets suspend bit
2018-07-27 17:16:00 -04:00