Andrea Orru
98a95cc698
exit, createThread for zen
2018-01-08 12:16:23 -05:00
Andrew Kelley
632d143bff
replace `a %% b` with `a catch b`
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 17:28:20 -05:00
Andrew Kelley
66717db735
replace `%return` with `try`
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 16:53:13 -05:00
Andrea Orru
3182857224
Adding zen support
2018-01-07 04:43:08 -05:00
Andrea Orru
ad438cfd40
Merge branch 'master' of github.com:zig-lang/zig
2018-01-06 23:13:51 -05:00
Andrea Orru
e932919e68
Darwin -> MacOSX, added Zen. See #438
2018-01-06 23:10:53 -05:00
Jimmi Holst Christensen
e91136d61f
Fixed the call to mem.readInt in endian.swap
2018-01-07 00:24:35 +01:00
Jimmi Holst Christensen
6f85c860c6
Fixed the call to mem.readInt in Rand.scalar
2018-01-07 00:24:17 +01:00
Andrew Kelley
dde7cc52d2
fix exp1m implementation
...
in the llvm6 branch with assertions on, it failed the test
this fixes it
2018-01-06 02:58:45 -05:00
Andrew Kelley
79d50d9933
appveyor: enable verbose link for self hosted compiler
2018-01-04 23:43:46 -05:00
Andrew Kelley
7e65fe7ac3
fix test regressions on windows from previous commit
2018-01-04 16:36:59 -05:00
Andrew Kelley
d008e209e7
self-hosted compiler works on macos
2018-01-04 15:30:22 -05:00
Andrew Kelley
e1c03d9e8e
self-hosted compiler works on windows
...
* better error message for realpath failing
* fix bug in std.io.readFileAllocExtra incorrectly returning
error.EndOfStream
* implement std.os.selfExePath and std.os.selfExeDirPath for windows
2018-01-04 13:48:45 -05:00
Andrew Kelley
0cd63b28f3
fix self-hosted build on windows
2018-01-03 22:38:13 -05:00
Andrew Kelley
36ff26609b
fix self hosted compiler on windows
2018-01-03 04:55:49 -05:00
Andrew Kelley
0ea50b3157
ir: new pass iteration strategy
...
Before:
* IR basic blocks are in arbitrary order
* when doing an IR pass, when a block is encountered, code
must look at all the instructions in the old basic block,
determine what blocks are referenced, and queue up those
old basic blocks first.
* This had a bug (See #667 )
Now:
* IR basic blocks are required to be in an order that guarantees
they will be referenced by a branch, before any instructions
within are referenced.
ir pass1 is updated to meet this constraint.
* When doing an IR pass, we iterate over old basic blocks
in the order they appear. Blocks which have not been
referenced are discarded.
* After the pass is complete, we must iterate again to look
for old basic blocks which now point to incomplete new
basic blocks, due to comptime code generation.
* This last part can probably be optimized - most of the time
we don't need to iterate over the basic block again.
closes #667
2018-01-02 21:08:12 -05:00
Peter Rönnquist
d15b02a6b6
Added format for floating point numbers. {.x} where x is the number of decimals.
2017-12-31 00:27:58 +01:00
Josh Wolfe
192a039173
move utf8 parsing to std
...
source files no longer need to end with a newline
2017-12-26 23:17:33 -07:00
Andrew Kelley
6fece14cfb
self-hosted: build against zig_llvm and embedded LLD
...
Now the self-hosted compiler re-uses the same C++ code for interfacing
with LLVM as the C++ code.
It also links against the same LLD library files.
2017-12-26 19:44:08 -05:00
Andrew Kelley
2a25398c86
fix segfault when passing union enum with sub byte...
...
...field to const slice parameter
we use a packed struct internally to represent a const array
of disparate union values, and needed to update the internal
getelementptr instruction to recognize that.
closes #664
2017-12-24 04:11:58 -05:00
Josh Wolfe
fb96c3e73e
debug needs to export FailingAllocator
2017-12-23 21:47:13 -07:00
Andrew Kelley
4183c6f1a5
move std/debug.zig to a subdirectory
...
self hosted compiler parser tests do some fuzz testing
2017-12-23 22:15:48 -05:00
Andrew Kelley
e0a1466bd8
build: add --search-prefix option
2017-12-23 22:14:35 -05:00
Andrew Kelley
2031989d98
std.os.path.resolve handles an absolute path that is missing the drive
2017-12-23 22:14:35 -05:00
Andrew Kelley
39c7bd24e4
port most of main.cpp to self hosted compiler
2017-12-23 00:57:56 -05:00
Andrew Kelley
e44a11341d
std.math: remove unnecessary inline calls and
...
workaround windows 32 bit test failure
See #537
2017-12-22 13:14:07 -05:00
Josh Wolfe
0e7fb69bea
bufPrint returns an error
2017-12-22 00:52:01 -07:00
Andrew Kelley
ea805c5fe7
fix darwin and windows from previous commit
2017-12-22 02:33:39 -05:00
Andrew Kelley
d917815d81
explicitly return from blocks
...
instead of last statement being expression value
closes #629
2017-12-22 00:50:30 -05:00
Andrew Kelley
8bc523219c
add labeled loops, labeled break, labeled continue. remove goto
...
closes #346
closes #630
regression: translate-c can no longer translate switch statements.
after #629 we can ressurect and modify the code to utilize arbitrarily
returning from blocks.
2017-12-20 23:00:19 -05:00
Andrew Kelley
1435604b84
add sort.min and sort.max functions to stdlib
2017-12-19 17:35:38 -05:00
Andrew Kelley
2a8160e80f
Merge branch 'export-rewrite'
...
introduces the `@export` builtin function which can be used
in a comptime block to conditionally export a function.
it also allows creation of aliases.
previous export syntax is still allowed.
closes #462
closes #420
2017-12-19 02:44:14 -05:00
Andrew Kelley
9d9201c3b4
bring back code that uses export and fix tests
...
partial revert of 1fdebc1dc4
2017-12-19 02:39:43 -05:00
Andrew Kelley
1fdebc1dc4
wip export rewrite
2017-12-18 09:59:57 -05:00
Andrew Kelley
3f65887974
fix std.mem missing error.OutOfMemory decl
...
this will be fixed in a better way later by #632
2017-12-17 20:52:29 -05:00
Andrew Kelley
39e96d933e
change mem.cmp to mem.lessThan and add test
2017-12-15 17:26:22 -05:00
Andrew Kelley
68f6332343
fix missing import from previous commit
2017-12-14 21:24:00 -05:00
Andrew Kelley
6bc0561d13
disable sort tests for 32-bit windows because of issue #537
2017-12-14 19:55:34 -05:00
Andrew Kelley
75ecfdf66d
replace quicksort with blocksort
...
closes #657
2017-12-14 19:41:35 -05:00
Andrew Kelley
f55fdc00fc
fix const and volatile qualifiers being dropped sometimes
...
in the expression `&const a.b`, the const (and/or volatile)
qualifiers would be incorrectly dropped.
closes #655
2017-12-13 21:53:52 -05:00
Andrew Kelley
cdaa735b2b
self-hosted: build tries to find llvm-config.exe
2017-12-12 16:40:04 -05:00
Andrew Kelley
2b9302107f
self-hosted: cleanup build looking for llvm-config
2017-12-12 16:03:20 -05:00
Andrew Kelley
cd5fd653d7
self-hosted: move code to std.os.ChildProcess.exec
2017-12-12 14:35:53 -05:00
Andrew Kelley
caa6433b56
stack traces: support DW_AT_ranges
...
This makes some cases print stack traces where it previously failed.
2017-12-12 12:05:28 -05:00
Andrew Kelley
23058d8b43
self-hosted: link with LLVM
2017-12-11 23:34:59 -05:00
Andrew Kelley
ed4d94a5d5
self-hosted: test all out of memory conditions
2017-12-11 21:12:47 -05:00
Andrew Kelley
c4e7d05ce3
refactor debug.global_allocator into mem.FixedBufferAllocator
2017-12-11 17:27:31 -05:00
Andrew Kelley
fd6a36a235
self-hosted: parsing and rendering blocks
2017-12-11 09:21:06 -05:00
Andrew Kelley
f210f17d30
add self-hosted parsing and rendering to main tests
2017-12-10 21:26:52 -05:00
Andrew Kelley
4b1d120f58
Merge remote-tracking branch 'origin/master' into self-hosted
2017-12-10 19:41:01 -05:00