Commit Graph

7503 Commits

Author SHA1 Message Date
Andrew Kelley
b9f37ffe19
fix outdated comment 2020-01-13 14:48:43 -05:00
Andrew Kelley
4f9739189e
add an extra assert 2020-01-13 14:48:43 -05:00
Andrew Kelley
c774c9376a
Merge pull request #3957 from xackus/stage2_parser_3799
stage2 parser: fix segfault on extern block
2020-01-13 13:38:31 -05:00
Emilio G. Cota
2be12b24bc doc/langref: mention that x is the sentinel in [N:x]T
Without looking at the example it is not possible to know
whether N or x is the sentinel value. Fix it.
2020-01-13 11:49:46 -05:00
Andrew Kelley
4d4852ad31
Merge pull request #4162 from LemonBoy/fix-4020
Fix @call being too eager to resolve the fn argument
2020-01-13 11:48:54 -05:00
LemonBoy
54b11f66a9 Fix compiler-error regression 2020-01-13 08:49:32 +01:00
Michael Dusan
d08009556e
Merge pull request #4161 from mikdusan/stage1-builtin-debugtrap
prefer C++ compiler builtins for BREAKPOINT
2020-01-12 18:28:10 -05:00
LemonBoy
34cdcb13c0 Fix @call being too eager to resolve the fn argument
Closes #4020
2020-01-12 23:51:18 +01:00
Michael Dusan
25b1ae0a5f
prefer C++ compiler builtins for BREAKPOINT
Fix breakpoints on macOS to trap EXC_BREAKPOINT with correct
source location when using lldb. Old behavior with `raise(SIGTRAP)`
traps SIGTRAP and incorrect source location.

Fix breakpoints on archlinux to trap SIGILL with correct source
location when using gdb. Old behavior with `raise(SIGTRAP)`
traps SIGTRAP and (sometimes) incorrect source location with
very shallow (break in main) stack.

when building stage1:
- w/ clang, use `__builtin_debugtrap()`
- w/ gcc, use `__builtin_trap()`
- else use `raise(SIGTRAP)`
2020-01-12 16:41:11 -05:00
LemonBoy
c96131f30c Propagate errors in for loop bodies
Closes #3819
2020-01-12 12:49:12 -05:00
hryx
c4770e7aa5 docs: update grammar to remove C strings and add anon literals 2020-01-12 04:35:45 -05:00
Michael Dusan
a6f6d8d2f7
Merge pull request #4139 from mikdusan/stage1-relative-path-errors
strip cwd from compile error paths
2020-01-11 19:21:54 -05:00
Michael Dusan
fc20a58993
strip cwd from compile error paths
closes #43138
2020-01-11 16:45:57 -05:00
data-man
860d88037a Correct TypeId docs 2020-01-11 15:59:00 -05:00
LemonBoy
34ae1d9aa8 Fix unsafe cast in translate_c
* Handle EmptyDecls to clean up the generated code

Closes #4143
2020-01-11 15:51:10 -05:00
Jonathan Marler
0827e298ed Add WaitForSingleObject function to std.os.windows 2020-01-11 15:49:48 -05:00
LemonBoy
95619ecb8c Stop dropping errors from clang
* Refactor the error-writing code to be more compact and flexible
2020-01-11 15:48:32 -05:00
xackus
5880eb3a75 stage2 parser: document undefined and clean up 2020-01-10 22:48:51 +01:00
LemonBoy
9cc7fb66bc Don't special-case builtin too much
Let's use the usual declaration-searching mechanism that resolves the
`usingnamespace` declarations on the go instead of directly peeking into
the symbol table.

Fixes #4134
2020-01-10 16:44:15 -05:00
LemonBoy
84e98405de Inform the debugger about the effective type sizes
Makes every debugger happy and closes #2685
2020-01-10 16:42:49 -05:00
xackus
f81529fab1 stage2 parser: fix segfault on extern block 2020-01-10 22:35:41 +01:00
LemonBoy
570ffc470e Handle forward-declared functions
Closes #4130
2020-01-10 16:34:40 -05:00
Andrew Kelley
e06a6b9645
Merge pull request #4129 from daurnimator/windows-child_process
Fix windows child process creation
2020-01-10 03:00:25 -05:00
travisstaloch
3f98756f85 Fix translation of signed array indices (#4113)
* cast only if the index is long long or signed
* cast long long to usize rather than c_uint

closes #4075
2020-01-10 00:08:24 -05:00
daurnimator
03e1241b88
std: avoid an allocation in inner loop 2020-01-10 15:03:51 +11:00
daurnimator
6fb636050f
std: fix off by one error in windows process creation 2020-01-10 15:00:14 +11:00
Andrew Kelley
ae324985a6
clean up a TODO in self-hosted 2020-01-09 15:31:49 -05:00
Andrew Kelley
5e345ff0ee
Merge pull request #3955 from LemonBoy/fix-1528
Pointer arithmetic affects the alignment factor
2020-01-09 13:53:56 -05:00
LemonBoy
5ab5de89c0 New @export() handling
Use a struct as second parameter to be future proof (and also allows to
specify default values for the parameters)

Closes #2679 as it was just a matter of a few lines of code.
2020-01-09 13:43:06 -05:00
Rocknest
4613e4d15f Fix C struct with function pointer member and typedefs mistranslated (#4122)
fixes #4118
2020-01-09 13:38:31 -05:00
Ryan Liptak
834218d789 Fix remaining variadic formatted prints
Used a series of regex searches to try to find as many instances of the old pattern as I could and update them.
2020-01-09 13:36:44 -05:00
daurnimator
d7333d8798 std: fix LoggingAllocator, add simple test 2020-01-09 13:34:46 -05:00
LemonBoy
c51b79c56e Correct alignment calculation for runtime addends 2020-01-09 11:56:45 +01:00
LemonBoy
27b290f312 Propagate more failures upwards
Fixes #4112
2020-01-08 17:25:00 -05:00
LemonBoy
7ea7842ed0 Fix calculation of new alignment factor 2020-01-08 21:02:05 +01:00
LemonBoy
7fe13f4a86 Pointer alignment fixes for the stdlib 2020-01-08 20:03:03 +01:00
LemonBoy
e134e6c994 Pointer arithmetic affects the alignment factor
Closes #1528
2020-01-08 20:03:03 +01:00
data-man
02ace4569e Correct @mulAdd's doc 2020-01-08 13:56:16 -05:00
Nathan Michaels
38ce7f64e3 Add removeIndex function to PriorityQueue (#4070)
It's awkward to use, but lets me cancel events in an event queue.

Co-authored-by: Dmitry Atamanov <data-man@users.noreply.github.com>
2020-01-08 13:55:47 -05:00
Andrew Kelley
0ebb07f95d
Merge pull request #4101 from LemonBoy/moremerwio
More translate-c fixes
2020-01-08 13:37:02 -05:00
LemonBoy
6a72eb1541 Use abort() instead of assert()
Let's see if the Windows/MacOS CI like this more...
2020-01-08 10:31:11 +01:00
LemonBoy
5b34697b21 Cast integer literals to their specified type 2020-01-08 10:19:04 +01:00
LemonBoy
fd7e69a2c0 More translate-c fixes
* Translate OpaqueValueExpr
* Translate BinaryConditionalOperator
* Fix translation of boolean->int casts
* Reoder some tokens to avoid rendering errors
2020-01-08 08:43:37 +01:00
LemonBoy
2a5c622e65 Fix crash with unresolved loc
Fixes #4099
2020-01-07 18:16:17 -05:00
Andrew Kelley
9f064bcf74
Merge pull request #4091 from xackus/json_copy_strings
json: implement copy_strings=false
2020-01-07 16:42:14 -05:00
Andrew Kelley
7b73c7fe12
Merge branch 'std-utf16-sentinel-terminated' of https://github.com/daurnimator/zig 2020-01-07 16:13:34 -05:00
Andrew Kelley
e2e9be5dea
Merge branch 'dcao-master'
closes #3981
2020-01-07 16:02:58 -05:00
Andrew Kelley
af390b75db
cleanups related to --eh-frame-hdr 2020-01-07 16:02:38 -05:00
David Cao
8e57dd57ca
add --eh-frame-hdr conditionally 2020-01-07 15:58:40 -05:00
David Cao
599213463d
add --eh-frame-hdr arg for linking 2020-01-07 15:58:39 -05:00