Commit Graph

9419 Commits (6dce317fe39443278ee744e66118c6e9b6023615)

Author SHA1 Message Date
Vexu b1ebaba408
std.json properly handle comptime int/float 2020-05-12 15:15:21 +03:00
Andrew Kelley 619159cf48 self-hosted: rework the memory layout of ir.Module and related types
* add TypedValue.Managed which represents a Type, a Value, and some
   kind of memory management strategy.
 * introduce an analysis queue
 * flesh out how incremental compilation works with respect to exports
 * ir.text.Module is only capable of one error message during parsing
 * link.zig no longer has a decl table map and instead has structs that
   exist directly on ir.Module.Decl and ir.Module.Export
 * implement primitive .text block allocation
 * implement linker code for updating Decls and Exports
 * implement null Type

Some supporting std lib changes:
 * add std.ArrayList.appendSliceAssumeCapacity
 * add std.fs.File.copyRange and copyRangeAll
 * fix std.HashMap having modification safety on in ReleaseSmall builds
 * add std.HashMap.putAssumeCapacityNoClobber
2020-05-12 01:02:48 -04:00
Greg Anders 9f496c0777 Add helper functions and docstrings to ascii.zig
* Add an upper case variant of `allocLowerString`
  * Add case-sensitive variants of `eqlIgnoreCase`, `indexOfIgnoreCase`,
    and `indexOfIgnoreCasePos`
  * Add and update docstrings on functions
2020-05-11 19:36:41 -06:00
Vexu 7456389ef3
Merge pull request #5308 from xiongxin/master
mem.eql need slice type
2020-05-12 01:41:51 +03:00
Vexu 7aee8a93eb
Merge pull request #5315 from xackus/fix-bigint_fits_in_bits
stage1: detect underflow in bigint_fits_in_bits
2020-05-12 01:25:24 +03:00
Vexu 0847b47bf8
fix `@intToFloat` on comptime_floats 2020-05-12 00:24:09 +03:00
Vexu 3e3c651b67
Merge pull request #5316 from marler8997/pubSockLen
make Address.getOsSockLen pub
2020-05-11 20:10:59 +03:00
Jonathan Marler 832f6c1228 make Address.getOsSockLen pub 2020-05-11 09:11:05 -06:00
xackus 204f8daeed stage1: detect underflow in bigint_fits_in_bits 2020-05-11 14:06:37 +02:00
熊鑫 0363f3c6f3
mem.eql need slice type 2020-05-10 20:35:21 +08:00
Andrew Kelley a32d3a85d2 rework self-hosted compiler for incremental builds
* introduce std.ArrayListUnmanaged for when you have the allocator
   stored elsewhere
 * move std.heap.ArenaAllocator implementation to its own file. extract
   the main state into std.heap.ArenaAllocator.State, which can be
   stored as an alternative to storing the entire ArenaAllocator, saving
   24 bytes per ArenaAllocator on 64 bit targets.
 * std.LinkedList.Node pointer field now defaults to being null
   initialized.
 * Rework self-hosted compiler Package API
 * Delete almost all the bitrotted self-hosted compiler code. The only bit
   rotted code left is in main.zig and compilation.zig
 * Add call instruction to ZIR
 * self-hosted compiler ir API and link API are reworked to support
   a long-running compiler that incrementally updates declarations
 * Introduce the concept of scopes to ZIR semantic analysis
 * ZIR text format supports referencing named decls that are declared
   later in the file
 * Figure out how memory management works for the long-running compiler
   and incremental compilation. The main roots are top level
   declarations. There is a table of decls. The key is a cryptographic
   hash of the fully qualified decl name. Each decl has an arena
   allocator where all of the memory related to that decl is stored.
   Each code block has its own arena allocator for the lifetime of
   the block. Values that want to survive when going out of scope in
   a block must get copied into the outer block. Finally, values must
   get copied into the Decl arena to be long-lived.
 * Delete the unused MemoryCell struct. Instead, comptime pointers are
   based on references to Decl structs.
 * Figure out how caching works. Each Decl will store a set of other
   Decls which must be recompiled when it changes.

This branch is still work-in-progress; this commit breaks the build.
2020-05-10 02:05:54 -04:00
Haze Booth e79d7e0ded Remove fs.File artifact from connectUnixSocket 2020-05-09 12:29:27 -04:00
Vexu d4d509090b
make std.build.getInstallPath public
Closes  #5299
2020-05-09 00:31:11 +03:00
Vexu 453df1cc1e
Merge pull request #4892 from Sobeston/patch-4
mem.zeroes - add sentinel terminated array support
2020-05-08 22:37:27 +03:00
Vexu 336ddb5b76
std: add test for mem.zeroes on sentinel terminated arrays 2020-05-08 19:03:27 +03:00
Vexu f2d3266075
Merge pull request #4932 from Qix-/fix-private-access
Fix private access
2020-05-08 18:21:15 +03:00
Vexu f1e5a4f163
Merge pull request #5296 from daurnimator/osx-RTLD
std: fix RTLD_ constants on OSX
2020-05-08 18:05:04 +03:00
daurnimator 45f7c78bfc
std: fix RTLD_ constants on OSX 2020-05-08 22:34:18 +10:00
Vexu 10abffcd98
fix more private member access 2020-05-08 15:10:38 +03:00
Josh Junon b6dc7fc9ff
publicize member functions affected by #4909 2020-05-08 14:26:28 +03:00
Josh Junon 4a5c58dd35
fix private member checking for non-canonical invocations (fixes #4909) 2020-05-08 14:26:13 +03:00
Josh Junon fbf081a306
add failing test for #4909 2020-05-08 14:26:13 +03:00
xackus 2c9effc101 stage1: handle all cases of invalid struct field default value 2020-05-07 16:39:16 -04:00
Andrew Kelley 3aa259d119 Merge branch 'kristoff-it-macos-kqueue'
closes #5286
2020-05-07 13:41:26 -04:00
Loris Cro 35a59b5b0f remove readable check when opening a socket connection 2020-05-07 13:41:17 -04:00
Loris Cro 7e8b859095 fix oneshot flag erroneusly set as filter_flag 2020-05-07 13:41:17 -04:00
Loris Cro a78ac96134 fix crash in single-threaded builds 2020-05-07 13:41:02 -04:00
xackus 79bf4003da stage1: add ZigList gdb pretty printing 2020-05-07 12:43:22 -04:00
Andrew Kelley ba43492c0e
Merge pull request #5268 from tadeokondrak/remove-callconv-redundant-syntax
Remove syntax redundant with callconv
2020-05-07 12:42:26 -04:00
Jens Goldberg 20c1696865 Removed GetModuleHandleA from user32
GetModuleHandleA is an kernel32 function and already defined there, it doesn't belong in user32.
2020-05-07 12:38:46 -04:00
Jens Goldberg 25810bc1e6 Removed duplicate WM_ACTIVATE 2020-05-07 12:38:46 -04:00
Vexu 54b2a6ec41
Merge pull request #5287 from marler8997/fixAllocWithPayload
fix copy/paste error in AllocWithOptionaPayload
2020-05-07 12:39:57 +03:00
Jonathan Marler 0a76e11617 add failAllocator to enable some regression tests 2020-05-06 23:56:48 -06:00
Jonathan Marler 0c7397b49f fix copy/paste error in AllocWithOptionaPayload 2020-05-06 23:08:08 -06:00
Timon Kruiper b336dda076 Standard library: Fix a regression in loop.waitUntilFdWritableOrReadable
This broke async io on linux.
Regressed in 8ebcca6734
2020-05-06 13:14:06 -04:00
Vexu 9c422c28f6
Merge pull request #5281 from data-man/hash_vector_nocopy
Optimization of vectors hashing
2020-05-06 18:12:35 +03:00
data-man 3c4abacba6 Optimization of vectors hashing 2020-05-06 17:08:49 +05:00
Vexu 0e30edd8d0
std: handle ConnectionTimedOut in switch
regression from #5266
closes #5270
2020-05-06 12:52:26 +03:00
Vexu 06e6d39c6c
Merge pull request #5257 from matt1795/scoped-typedef
Add scoped typedef to translate-c
2020-05-06 12:28:30 +03:00
Vexu c0b269bf46
translate-c: small patch to fix bultin type detection 2020-05-06 11:48:46 +03:00
Matthew Knight 52f0adb305 checkForBuiltinTypedef now returns a string 2020-05-05 23:26:00 -07:00
Lann eb4fa63d3d
Remove reference to import type (#5279)
* Remove reference to import type
* Improve language in `@This()` doc
2020-05-05 19:13:35 -04:00
Andrew Kelley ae080b5c21 readme: remove the part about stage2 until it's done 2020-05-05 15:26:36 -04:00
Andrew Kelley ad43155f25 Merge branch 'haze-hb/test-evented-io-build-zig'
closes #5274
2020-05-05 15:18:34 -04:00
Andrew Kelley 6f3d76f61e simplify test-evented-io build setting 2020-05-05 15:18:04 -04:00
Haze Booth a39cb034ea Add setUseTestEventedIO for test steps in build.zig 2020-05-05 15:16:54 -04:00
Andrew Kelley b13a02ed1a avoid unnecessary fcntl syscalls when setting socket flags 2020-05-05 12:50:50 -04:00
Andrew Kelley 0a2104689b fix incorrect flags being set in os.setSockFlags
fixes networking stuff on darwin
2020-05-05 12:45:39 -04:00
Tadeo Kondrak 84a0a9688c
update docs/tests for async/extern fn removal 2020-05-05 10:31:32 -06:00
StrangeBug 54088fe6e1 Add support for external links and URL to markdown parser. 2020-05-05 18:09:32 +02:00