Commit Graph

1256 Commits (e4ec2d10c67542589e10e1eaf569157284171159)

Author SHA1 Message Date
Andrew Kelley e4ec2d10c6 zig build system: implement custom command step 2017-04-17 06:47:20 -04:00
Andrew Kelley 47336abae3 improvements to zig build system and unwrap error safety
* zig build system: create standard dynamic library sym links
 * unwrapping an error results in a panic message that contains
   the error name
 * rename error.SysResources to error.SystemResources
 * add std.os.symLink
 * add std.os.deleteFile
2017-04-17 06:47:20 -04:00
Andrew Kelley d16ce67106 zig build system: ability to link against dynamic library step 2017-04-17 06:47:20 -04:00
Josh Wolfe 3a8490f7e9 add tests for implicit semicolon. closes #297 2017-04-14 16:29:42 -07:00
Josh Wolfe 3e93796e24 comptime ({}) should not get an implicit semicolon
closes #292.
2017-04-14 16:09:01 -07:00
Andrew Kelley 5fdefe58e4 zig build system understands the concept of dependencies
See #204
2017-04-13 17:21:00 -04:00
Andrew Kelley a6bd3d8ca2 move emacs/vim files to separate repos 2017-04-13 05:27:59 -04:00
Andrew Kelley dcfa0e50dc all internal functions get unnamed_addr attribute 2017-04-13 03:34:57 -04:00
Andrew Kelley f2140efc52 Merge remote-tracking branch 'origin/parser' 2017-04-13 03:09:09 -04:00
Andrew Kelley bf57d8a7e3 typedefpocalypse
closes #314
2017-04-13 03:07:58 -04:00
Josh Wolfe 356424916c block statement lists never get fake expressions
instead blocks have a field that encodes whether the last statement ended with
a semicolon.
2017-04-12 23:22:32 -07:00
Josh Wolfe 919910312d make it an error to ignore a statement's value
this makes {1;} an error.
2017-04-12 22:21:35 -07:00
Andrew Kelley bf67427c67 fix crash when using zig to link
without explicit dynamic linker
2017-04-13 01:15:25 -04:00
Andrew Kelley 41144a8566 ability to inline at function callsite
closes #306
2017-04-13 00:13:54 -04:00
Andrew Kelley f043e0e85c build: ignore libLLD.so when it is a broken symlink
closes #318
2017-04-13 00:12:44 -04:00
Andrew Kelley 403eb92a62 try harder to find lld 2017-04-11 06:44:45 -04:00
Andrew Kelley 2864359950 zig build system writes template build.zig file when none exists
see #204
2017-04-11 06:14:46 -04:00
Andrew Kelley 7f47b0c271 run alwaysinline pass in debug mode
before this commit, the optimized IR code that is displayed in
--verbose mode is not actually what gets emitted to an object
file.

that is now corrected, and we make sure to run the alwaysinliner
pass even in debug mode, so you can rely on "inline" keyword
inlining a function, guaranteed.

See #306
2017-04-11 03:37:44 -04:00
Andrew Kelley 11a6550324 fix some -Wconversion errors 2017-04-10 20:02:39 -04:00
Andrew Kelley 34eff50326 fix for loops not working at compile-time
closes #315
2017-04-10 03:00:19 -04:00
Andrew Kelley 0e77b0ac89 fix mangling exported global variables
closes #316
2017-04-10 02:32:11 -04:00
Andrew Kelley 095591f0b0 add enumTagName builtin function
closes #299
2017-04-08 17:45:22 -04:00
Andrew Kelley 7611ed3484 allow implicit cast from `[N]T` to `&const []const T`
closes #296
2017-04-07 17:56:01 -04:00
Andrew Kelley 5eb78ba177 fix std.mem.IncrementingAllocator
updating ptr casting because of previous commit
2017-04-07 15:38:31 -04:00
Andrew Kelley f7e9d7aa5d ability to implicitly cast integer literal to &const Int
where Int is an integer type

also introduce `@intToPtr` builtin for converting a usize
to a pointer. users now have to use this instead of `(&T)(int)`.

closes #311
2017-04-07 15:35:38 -04:00
Andrew Kelley ffb4852012 add compile error for the bug of unable to call var ags at compile time
See #313
2017-04-07 00:33:19 -04:00
Andrew Kelley a3de550d3b fix var args having wrong index when runtime param before it
closes #312
2017-04-06 21:00:49 -04:00
Andrew Kelley 273cebdf4d peer resolve types [N]T, [M]T as []const T
closes #125
2017-04-06 18:07:38 -04:00
Andrew Kelley 47f58d6d02 fix runtime struct initialization of bitfield
closes #308
2017-04-06 15:04:18 -04:00
Andrew Kelley 10dbc735fe zig build: use -D for options instead of -O
because -O is usually optimization level
2017-04-06 13:59:11 -04:00
Andrew Kelley 6fbe1632d0 Update zig build system to support user defined options
* Fix assertion failure when switching on type.
   Closes #310
 * Update zig build system to support user defined options.
   See #204
 * fmt.format supports {sNNN} to set padding for a buffer arg.
 * add std.fmt.bufPrint and std.fmt.allocPrint
 * std.hash_map.HashMap.put returns the previous value
 * add std.mem.startsWith
2017-04-06 05:34:04 -04:00
Andrew Kelley d15bcdce69 std: ChildProcess.spawn looks at PATH env var
closes #303
2017-04-05 17:55:50 -04:00
Andrew Kelley d65cd73a8b add support to use zig as a linker driver
closes #243

I also added --grep to ./run_tests if you want to single out
some specific tests
2017-04-05 07:49:40 -04:00
Andrew Kelley 8c10b6dcbd ability to use zig as an assembler
see #243
2017-04-05 03:36:55 -04:00
Andrew Kelley a461ae6c1f fix crash when referencing invalid member of builtin enum
closes #304
2017-04-04 21:36:24 -04:00
Andrew Kelley e30f713640 more accurate detection of pub main 2017-04-04 21:19:22 -04:00
Andrew Kelley 0edc2b19fe support module level assembly
closes #256
2017-04-04 19:47:22 -04:00
Andrew Kelley d97285eb65 doc: link to Andrea's emacs mode 2017-04-04 15:37:42 -04:00
Andrew Kelley 9c803af044 zig build system: fix cleanup on error, report spawn error 2017-04-04 06:47:42 -04:00
Andrew Kelley 00efbfa054 link: correctly print debug linker invocation 2017-04-04 06:15:23 -04:00
Andrew Kelley 8db9d04e6f link: fix ignoring first linker arg
LLD treats the first argument as arg[0], the exe name
2017-04-04 06:07:09 -04:00
Andrew Kelley e332cd65c9 zig build system: delete ./build file on success
see #204
2017-04-04 02:02:51 -04:00
Andrew Kelley 1c6000d047 zig build system improvements, add some std API
* add std.buf_map.BufMap
 * add std.buf_set.BufSet
 * add std.mem.split
 * zig build system improvements (See #204)
   - automatically parses NIX_CFLAGS_COMPILE and NIX_LDFLAGS
   - add builder.addCIncludePath
   - add builder.addRPath
   - add builder.addLibPath
   - add exe.linkLibrary
2017-04-04 01:52:20 -04:00
Andrew Kelley 72fb2443e0 API for command line args
closes #300
2017-04-04 00:17:24 -04:00
Andrew Kelley b46344fd01 link: delete code that checks the linker version
since we depend on LLD for linking
2017-04-03 23:29:53 -04:00
Andrew Kelley 55dd2676ef fix std build for darwin 2017-04-03 19:30:03 -04:00
Andrew Kelley c9ae30d27e delete alloca builtin function
See #225

introduce os.EnvMap
2017-04-03 18:11:57 -04:00
Andrew Kelley c400cb429a zig build system: add setLinkerScript and setTarget
* See #204 - zig build system
 * allow builtin types Os, Environ, Arch to be used at runtime.
   they have zero_bits=false and debug info now.
 * Eradicate use of `@alloca` in std for syscalls. See #225
 * add `std.io.writeFile`
 * `std.debug.panic` adds a newline to format
2017-04-03 05:04:46 -04:00
Andrew Kelley a1363b5227 proof of concept build system
see #204
2017-04-02 20:44:04 -04:00
Andrew Kelley 640389bb2b expose environment variables in standard library
closes #118
2017-04-02 19:14:23 -04:00