Andrew Kelley
4696cd3e09
fix ability to call methods on enums with pointer-to-self
...
closes #3218
2020-07-14 14:38:40 -07:00
Andrew Kelley
67273cbe76
Merge pull request #5868 from ziglang/stage2-improvements
...
Stage2 improvements
2020-07-14 09:24:43 +00:00
Andrew Kelley
a92990f993
stage2: implement enough for assert() function to codegen
2020-07-14 02:24:12 -07:00
Andrew Kelley
135580c162
stage2: fix liveness analysis of Call instructions
2020-07-13 23:48:54 -07:00
Andrew Kelley
5da5ded743
stage2: detect unreferenced non-volatile asm and NOT
2020-07-13 23:48:26 -07:00
~nue
03f14c3102
Added octal formatting fo fmt functions. ( #5867 )
...
* Added octal formatting (specifier "o") to `formatIntValue` function.
* Added octal specifier test case in `fmt.zig` (under the "int.specifier" case)
2020-07-14 02:27:58 -04:00
Andrew Kelley
4f5e065d6e
stage2: add ZIR support for BoolNot
2020-07-13 20:47:47 -07:00
Andrew Kelley
14cef9dd3d
stage2 parser: split out PrefixOp into separate AST Nodes
...
This is part of a larger effort to improve the memory layout of AST
nodes of the self-hosted parser to reduce wasted memory. Reduction of
wasted memory also translates to improved performance because of fewer
memory allocations, and fewer cache misses.
Compared to master, when running `zig fmt` on the std lib:
* cache-misses: 801,829 => 768,624
* instructions: 3,234,877,167 => 3,232,075,022
* peak memory: 81480 KB => 75964 KB
2020-07-13 20:13:51 -07:00
Nathan Michaels
bc900cdeaf
Document top-level doc comments, per #2288 .
2020-07-13 22:57:23 +00:00
Andrew Kelley
fabdef44a8
Merge pull request #5831 from paulespinosa/langref-hello-world-more
...
Explain Language Ref's Hello World
2020-07-13 22:45:32 +00:00
Paul Espinosa
a8d8ce9733
Use Writer for Language Reference Hello World Example
...
`OutStream` has been deprecated, so the "Hello, World!" example has been
updated to use `Writer`.
2020-07-13 22:41:57 +00:00
Andrew Kelley
204f61d7f5
stage2: Module: use StringHashMapUnmanaged
2020-07-13 15:34:31 -07:00
Andrew Kelley
75a720565b
Merge branch 'stage2-condbr'
2020-07-13 00:32:12 -07:00
Andrew Kelley
c94652a2fd
stage2: add new test case
2020-07-13 00:31:55 -07:00
Andrew Kelley
08154c0deb
stage2: add retvoid support to CBE
2020-07-13 00:28:11 -07:00
Andrew Kelley
25b1c00c72
stage2: add implicit return void where applicable
2020-07-13 00:08:21 -07:00
Andrew Kelley
c306392b44
stage2: codegen: more branching support
2020-07-13 00:08:21 -07:00
Andrew Kelley
b75a51f94b
stage2: implement function calling convention for calls
2020-07-13 00:08:21 -07:00
Andrew Kelley
8fe63d5042
stage2: peer type resolution with noreturn
2020-07-13 00:08:21 -07:00
Andrew Kelley
1cab40d783
Merge pull request #5864 from pixelherodev/cbe
...
CBE: get basic returns working
2020-07-13 07:07:27 +00:00
Noam Preil
8d6cadee16
CBE: Code cleanup
2020-07-13 01:49:04 -04:00
Noam Preil
4a46248198
CBE: Only generate (void) for calls whose return values are ignored
2020-07-13 01:49:04 -04:00
Noam Preil
a124b027b4
CBE: Use hasCodeGenBits instead of checking against void and noreturn
2020-07-13 01:49:04 -04:00
Noam Preil
3bad1c16cc
Get basic return test working
2020-07-13 01:49:04 -04:00
pixelherodev
2c882b2e65
CBE: Make C an ObjectFormat instead of a special bool ( #5849 )
2020-07-12 22:56:31 -04:00
Vexu
dff1ac1089
check for invalid sentinel when creating pointer with @Type
2020-07-13 00:29:53 +00:00
Isaac Freund
ef17af1270
std: add mem.joinZ
...
currently the only options are doing a second allocation and copying or
implementing this yourself.
2020-07-12 22:17:40 +00:00
xackus
5b570bceb5
document a few functions in std.mem
2020-07-12 21:55:49 +00:00
Andrew Kelley
7adbc11403
Merge pull request #5857 from daurnimator/use-unmanaged
...
Use unmanaged datastructures from std.http.headers
2020-07-12 21:46:26 +00:00
Sam Tebbs
873e187f05
Make allocator test functions public
2020-07-12 21:45:25 +00:00
Jakub Konka
eea7271c4e
Fix incorrect continue condition in PreopeonList
...
Also, check for overflow on incremented file descriptors. Previously,
we'd trigger a panic if we exceeded the `fd_t` resolution. Now, instead,
we throw an `error.Overflow` to signal that there can be no more
file descriptors available from the runtime. This way we give the user
the ability to still be able to check if their desired preopen exists
in the list or not.
2020-07-12 21:02:33 +00:00
daurnimator
91235b9371
std: don't store allocator inside of std.http.HeaderEntry
2020-07-13 00:38:59 +10:00
daurnimator
f7e4014c82
std: use *Unmanaged data structures in http.Headers object
2020-07-13 00:34:58 +10:00
daurnimator
4b48266bb7
std: add StringHashMapUnmanaged
2020-07-13 00:34:02 +10:00
Vexu
e1a5e061ca
revert accidental format of tests
...
these test the tokenizers handling of EOF and formatting makes them useless
2020-07-12 11:27:50 +03:00
Vexu
bfe9d4184f
fix alignment parsing in stage1
2020-07-12 07:35:34 +00:00
Andrew Kelley
fe08a4d065
Merge pull request #5846 from Vexu/anytype
...
Rename 'var' type to 'anytype'
2020-07-12 07:35:01 +00:00
Andrew Kelley
2dcb70a6be
Merge pull request #5847 from Vexu/decl
...
Take advantage of new HashMap API's preserving order
2020-07-12 07:31:48 +00:00
Andrew Kelley
f23987db7d
Sponsors Button => ZSF
...
Zig Software Foundation
2020-07-11 18:33:56 -04:00
Vexu
be1507a7af
update compile error tests and some doc comments
2020-07-12 00:54:07 +03:00
Vexu
3e095d8ef3
use 'anytype' in translate-c
2020-07-11 22:04:38 +03:00
Vexu
1a989ba39d
fix parser tests and add test for anytype conversion
2020-07-11 21:20:50 +03:00
Vexu
e85fe13e44
run zig fmt on std lib and self hosted
2020-07-11 20:41:19 +03:00
Vexu
9907116478
use typeInfo instead of hardcoded tables in std.Target
2020-07-11 20:11:20 +03:00
Vexu
2e6688ae27
Add test for @typeInfo declarations showing up in declaration order
...
Both the stage1 and std lib HashMap implementations now preserve insertion order
2020-07-11 19:51:20 +03:00
Vexu
8110639c79
add 'anytype' to stage1 and langref
2020-07-11 17:41:33 +03:00
Vexu
c2fb4bfff3
add 'anytype' to self-hosted parser
2020-07-11 17:41:16 +03:00
Paul Espinosa
b45a2d72c8
Introduce Error Union and Use Writer
...
This commit edits the "Hello, World!" introduction. It introduces Error Union
Types. Also, it changes `outStream` to `writer` in the code example and description.
2020-07-11 18:08:00 +07:00
Vexu
2e037fd827
use correct cast function when doing @floatCast at comptime
2020-07-11 11:36:28 +03:00
Paul
e57458a94f
Update doc/langref.html.in
...
Co-authored-by: Joachim Schmidt <joachim.schmidt557@outlook.com>
2020-07-11 09:10:08 +07:00