Andrew Kelley
901b5c1566
add compile error for function prototype with no body
...
closes #1231
2018-08-28 15:39:32 -04:00
Andrew Kelley
09cc1dc660
fix crash when var in inline loop has different types
...
closes #917
closes #845
closes #741
closes #740
2018-08-28 15:24:28 -04:00
Andrew Kelley
45d9d9f953
minor fixups
2018-08-27 18:31:28 -04:00
raulgrell
e2a9f2ef98
Allow implicit cast from *T and [*]T to ?*c_void
2018-08-27 23:13:57 +01:00
Andrew Kelley
009e90f446
fix @typeInfo unable to distinguish compile error vs no-payload
...
closes #1421
closes #1426
2018-08-27 17:13:34 -04:00
Andrew Kelley
2f2215c9f4
this was intended to be included in the previous commit
2018-08-27 16:26:36 -04:00
Andrew Kelley
526d8425ab
fix false negative determining if function is generic
...
This solves the smaller test case of #1421 but the
other test case is still an assertion failure.
2018-08-27 16:14:48 -04:00
Andrew Kelley
68e2794e15
ir: const_ptr_pointee asserts that its return value is non-null
2018-08-26 13:13:26 -04:00
Andrew Kelley
6a3fad1d59
Revert "src/ir.cpp: check return value of const_ptr_pointee to protect against dereferencing null pointers;"
...
This reverts commit 0839ed1f945dbbe3ad1f780a5334ad16ad12fd5e.
I realized too late there is a better fix. See PR #1419
2018-08-26 13:04:58 -04:00
kristopher tate
0839ed1f94
src/ir.cpp: check return value of const_ptr_pointee to protect against dereferencing null pointers;
2018-08-26 13:02:09 -04:00
Andrew Kelley
8047f0eae2
fix llvm assertion failure when building std lib tests for macos
...
closes #1417
2018-08-26 02:36:18 -04:00
Andrew Kelley
815950996d
Merge remote-tracking branch 'origin/master' into macos-stack-traces
2018-08-25 04:48:58 -04:00
Andrew Kelley
02f5a9fa62
fix handling multiple extern vars with the same name
2018-08-25 03:55:59 -04:00
Andrew Kelley
b95ff12f2f
fix regressions
2018-08-25 03:40:47 -04:00
Andrew Kelley
ac36f98e72
fix stack traces on linux
2018-08-25 03:07:37 -04:00
Marc Tiehuis
05f9b14fc2
Fix builtin alignment type
...
Closes #1235 .
2018-08-24 17:57:17 +12:00
Andrew Kelley
3a02ba9b82
fix error message for incorrect panic handler fn signature
...
closes #1353
2018-08-23 23:22:48 -04:00
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