Andrew Kelley
b7811d3269
whitespace cleanup
2019-06-10 00:45:24 -04:00
SamTebbs33
6c160b8856
Add check for null body in if, for and while
2019-06-10 00:41:33 -04:00
Andrew Kelley
b735764898
different array literal syntax when inferring the size
...
old syntax: []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}
closes #1797
2019-06-09 19:26:32 -04:00
Andrew Kelley
5784631fab
update the default macos version min to 10.14
2019-06-07 12:20:02 -04:00
Nick Erdmann
d83b15febf
src/ast_render.cpp: fix rendering of character literals <= 0x0f
2019-06-04 13:00:41 -04:00
LemonBoy
291aaee977
Stop the musl builder from skipping necessary files
...
The code assumed that the architecture-specific bits, found in the arch/
subfolder, were only overrides for the generic .c files.
Changed the logic to always include the whole architecture-specific
implementations and discard the generic ones, this way we won't exclude
files with no .c counterpart.
2019-06-04 12:45:02 -04:00
LemonBoy
80cd142c96
Propagate DIFlags to LLVM
2019-06-04 09:05:33 +02:00
LemonBoy
ebe921e48f
Make void a signed type
...
Follow the convention set by C so that lldb stops complaining about it.
2019-06-04 09:05:12 +02:00
Andrew Kelley
78f32259da
default struct field initialization expressions
...
closes #485
2019-05-30 15:46:11 -04:00
Andrew Kelley
5954d5235f
Merge pull request #2182 from mikdusan/issue.2046
...
new .d file parser for stage1 compiler
2019-05-30 11:53:08 -04:00
tgschultz
f9e7bd2682
std.meta/trait: def/definition => decl/declaration
...
TypeInfo: defs/Definition => decls/Declarations
2019-05-29 20:43:07 -04:00
Shawn Landden
4188faeac5
stage1: AstNodes cannot be casted, but are rather accessed via a union.
...
Unlike IrInstruction[Foo]s, which all start with:
IrInstruction base;
AstNodes do not work like this, and instead use a pointer to their
specializations. The code assumed otherwise.
2019-05-29 20:21:07 -04:00
Andrew Kelley
b7a82288ad
change use to usingnamespace
...
See #2014
`use` syntax is still accepted for now. `zig fmt` automatically
updates code. After a release cycle the old syntax will be removed.
2019-05-29 19:09:58 -04:00
Andrew Kelley
9a7cf73b3b
main: set subsystem in zig builtin when explicitly provided
2019-05-29 18:18:18 -04:00
Andrew Kelley
3819654c39
codegen: initialize subsystem
2019-05-29 16:55:02 -04:00
Andrew Kelley
1ab0ac3ea2
cleanups for windows subsystem in builtin.zig
2019-05-29 16:55:02 -04:00
emekoi
b461e600e2
set subsystem to null if not on windows or uefi
2019-05-29 16:55:01 -04:00
emekoi
6bc5b07e3e
try to resolve TargetSubSystemAuto to actual subsystem
2019-05-29 16:55:01 -04:00
emekoi
fb5dc28921
added subsystem to builtin.zig
2019-05-29 16:54:59 -04:00
Andrew Kelley
1ccbd1fb67
use works on unions and enums in addition to structs
2019-05-29 16:31:49 -04:00
Andrew Kelley
9891c4f30d
Merge branch 'use-struct-pt2' of https://github.com/LemonBoy/zig into LemonBoy-use-struct-pt2
2019-05-29 15:48:49 -04:00
Michael Dusan
2975bdc684
add review changes
...
- use std.heap.c_allocator
- use @panic instead of unreachable
- use extern enum for tokenizer result type
2019-05-29 14:39:13 -04:00
Andrew Kelley
b66438eb80
no "use of undeclared identifer" in dead comptime branches
2019-05-28 18:19:27 -04:00
LemonBoy
528c151a55
Reject undefined as type
...
Make analyze_type_expr behave like ir_resolve_type when the user tries
to use `undefined` as a type.
Closes #2436
2019-05-28 18:02:57 -04:00
LemonBoy
a169d844c7
Warn the user if run/test is paired with emit options
2019-05-28 17:50:28 -04:00
LemonBoy
048169cbea
Avoid a crash when there are no namespace components
...
Fixes #2500
2019-05-28 17:49:37 -04:00
Andrew Kelley
9d16839420
fix invalid LLVM IR generated for ?*void const casts
...
closes #2578
2019-05-28 16:11:36 -04:00
LemonBoy
e2c2263434
Move __zig_fail_unwrap locals on stack
2019-05-28 13:02:45 -04:00
emekoi
3f302594b8
respect subsystem flag in all cases
2019-05-27 22:15:33 -04:00
Andrew Kelley
f924fbddcf
Merge pull request #2552 from Sahnvour/issue-2543
...
gen-h: do not output visibility macros when the build is static
2019-05-27 21:51:34 -04:00
Andrew Kelley
2c0280ba08
improve the stack check CLI options
...
See #2526
2019-05-27 20:59:19 -04:00
Michael Dusan
d4b241c14e
new .d file parser for C compilation
...
- wip for #2046
- clang .d output must be created with `clang -MV` switch
- implemented in Zig
- hybridized for zig stage0 and stage1
- zig test src-self-hosted/dep_tokenizer.zig
2019-05-27 19:47:10 -04:00
Andrew Kelley
f68d8060ec
Merge pull request #2526 from LemonBoy/arch-format-osx
...
Build archives using the K_DARWIN format when targeting osx
2019-05-27 19:25:58 -04:00
Andrew Kelley
df7aa9a4f0
allow implicit optional pointer to optional c_void pointer
2019-05-26 17:55:20 -04:00
Andrew Kelley
269a53b6af
introduce @hasDecl builtin function
...
closes #1439
2019-05-26 16:21:03 -04:00
Andrew Kelley
21ed939117
support enum literals implicit casting to tagged unions
2019-05-26 12:59:30 -04:00
Sahnvour
99ee0608f7
gen-h: do not output visibility macros when the build is static
2019-05-25 14:17:59 +02:00
LemonBoy
86b3007b94
Reject slices in use expressions
...
Co-Authored-By: emekoi <emekankurumeh@outlook.com>
2019-05-24 13:20:44 +02:00
LemonBoy
f67ca20655
Make use work with arbitrary structs
2019-05-21 17:07:40 +02:00
LemonBoy
7987202243
Fix signedness mismatch in comparison
2019-05-20 23:14:49 +02:00
LemonBoy
266b2de150
Remove macos-specific linking hacks
2019-05-20 23:09:25 +02:00
LemonBoy
f5657b5552
Build archives using the K_DARWIN format when targeting osx
2019-05-20 17:04:00 +02:00
LemonBoy
6672ee9eb3
Fix too eager comptime evaluation of error ptr
2019-05-19 15:53:32 -04:00
LemonBoy
b660134a18
Use the correct scope for use
...
use expressions outside the top-level scope now work as intended.
2019-05-19 00:32:49 -04:00
LemonBoy
0a3aec020a
Fix load/store of non-integer fields in packed struct
2019-05-18 19:59:47 -04:00
Andrew Kelley
2eba779af5
stage1 tokenizer: add more missing break statements
2019-05-16 16:50:24 -04:00
SamTebbs33
87901baa28
Add break after digit_value check in TokenizeStateCharCode
2019-05-16 16:49:26 -04:00
Andrew Kelley
80983ca1ca
fixups to the previous commit
2019-05-16 16:37:58 -04:00
Shawn Landden
1fdb24827f
breaking changes to all bit manipulation intrinsics
...
* `@clz`, `@ctz`, `@popCount`, `@bswap`, `@bitreverse` now
have a type parameter
* rename @bitreverse to @bitReverse
* rename @bswap to @byteSwap
Closes #2119
Closes #2120
2019-05-16 16:37:58 -04:00
Andrew Kelley
81e960eb74
improvements to build-lib use case of WebAssembly
...
* build-exe does include the startup code that supplies _start for the
wasm32-freestanding target. Previously this did not occur because
of logic excluding "freestanding".
* build-lib for wasm32-freestanding target gets linked by LLD. To avoid
infinite recursion, compiler_rt and zig libc are built as objects
rather than libraries.
- no "lib" prefix and ".wasm" extension instead of ".a". Rather than
build-lib foo.zig producing "libfoo.a", now it produces "foo.wasm".
* go back to using `.o` extension for webassembly objects
* zig libc only provides _start symbol for wasm when linking libc.
2019-05-16 13:56:56 -04:00