Commit Graph

1173 Commits (329457bb4f714a8392153dfecfabd6f356144688)

Author SHA1 Message Date
Andrew Kelley 329457bb4f Merge branch 'master' into lld 2017-03-14 21:39:04 -04:00
Andrew Kelley a76558db26 fix behavior with reinterpreting constant memory 2017-03-14 21:38:27 -04:00
Andrew Kelley 7efa2cd81c add --each-lib-rpath option and corresponding config option
This adds an rpath entry for each used dynamic library directory.
This is necessary on some systems such as NixOS.
2017-03-13 13:11:55 -04:00
Andrew Kelley d10bbd28e9 use lld instead of system linker 2017-03-13 11:54:56 -04:00
Andrew Kelley 7bc0145b80 types with zero bits do not have a pointer handle 2017-03-10 11:30:30 -05:00
Andrew Kelley 434f017aee codegen nullable void the same way as bool
See #104
2017-03-10 11:21:41 -05:00
Andrew Kelley c78dc5043b add default value for macosx version min when compiling natively
closes #264
2017-03-10 02:58:23 -05:00
Andrew Kelley c91dbdb27c fix not allocating enough memory for passing args
fixes a bug introduced in c62db5721c
2017-03-10 02:50:53 -05:00
Andrew Kelley cd31f875a6 update to llvm 4.0 2017-03-10 02:29:01 -05:00
Andrew Kelley 47f267d25f break off some of std.io into std.fmt, generalize printf
closes #250
2017-03-09 19:12:15 -05:00
Andrew Kelley c62db5721c support passing var args directly
See #77
2017-03-09 16:13:38 -05:00
Andrew Kelley 558ae2f21a fix a case of invalid ptr const-ness 2017-03-08 17:02:18 -05:00
Andrew Kelley ddd9624e2d fix assertion error, trying to dereference to array
thanks to hoppetosse on IRC for reporting the issue
2017-03-07 19:08:02 -05:00
Andrew Kelley eb9f1e2d53 add basic emacs syntax file 2017-03-02 23:03:44 -05:00
Andrew Kelley b78752e2d2 remove zeroes from vim syntax file 2017-03-02 23:03:30 -05:00
Andrew Kelley 0b942f5ee2 Merge pull request #269 from Jmeggesto/master
Fix unused return value in darwin.zig
2017-03-02 19:21:58 -05:00
Jackie Meggesto 5bbde1dc91 Fix unused return value in darwin.zig 2017-03-02 19:21:02 -05:00
Andrew Kelley 6d0afc2bd2 add compile error for assigning number literal to non-comptime var 2017-03-02 18:51:19 -05:00
Andrew Kelley 03b6d9f547 fix assertion failure for some switch errors 2017-02-28 03:32:12 -05:00
Andrew Kelley 9eb29e81f9 rename CBuf to Buffer0 and some minor std API changes 2017-02-28 03:07:11 -05:00
Andrew Kelley 1195994880 fix inability to write to global in some cases
before, when we initialized a variable by copying the
initialization value, it made the internal const value
references point to a duplicate value, resulting in
a phony duplicate global value being updated instead of
the real on. now the behavior is as expected.

thanks to hoppetosse for pointing out this bug on IRC.
2017-02-27 00:07:11 -05:00
Andrew Kelley 25761570f1 more robust const struct values 2017-02-26 23:50:04 -05:00
Andrew Kelley 8dd0b4e1f1 add passing test for floating point edge case 2017-02-26 16:30:15 -05:00
Andrew Kelley 0ac1934ad6 fix examples 2017-02-26 14:35:30 -05:00
Andrew Kelley c36b0fec8e README: more robust suggested configuration command
thanks to jabb from IRC
2017-02-24 16:10:11 -05:00
Andrew Kelley 889bed13c3 unwrap error payload instruction has side effects only if safety check on 2017-02-24 15:11:33 -05:00
Andrew Kelley cd992b89d2 fix unwrap error payload not emitting debug safety 2017-02-24 15:07:46 -05:00
Andrew Kelley a665872e88 add compile error for ignoring return value
also introduce the _ identifier which you can assign to
to discard a return value

closes #219
2017-02-24 15:01:19 -05:00
Andrew Kelley 3b40aaa01f add compile error for control flow using comptime var at runtime
closes #266
2017-02-24 13:57:00 -05:00
Andrew Kelley 4b99f5978f add character format specifier to std.io.OutStream.printf 2017-02-23 18:56:10 -05:00
Andrew Kelley 3075d8aee7 fix use decls not always working 2017-02-23 16:52:13 -05:00
Andrew Kelley fe3063e58c update std code for MacOS
closes #264
2017-02-23 16:13:57 -05:00
Andrew Kelley b1ace32f23 fix wrong format specifier
closes #263
2017-02-22 15:36:57 -05:00
Andrew Kelley 786677f80c fix regression with bit fields that align properly 2017-02-22 00:58:31 -05:00
Andrew Kelley d794549985 bitfields support for array of non-store-aligned packed structs 2017-02-22 00:49:10 -05:00
Andrew Kelley cf5108f222 correct size of types for packed structs
with byte aligned but non-power-of-2 fields such as 24
2017-02-21 14:22:23 -05:00
Andrew Kelley 4709fe1176 more robust detection of types that failed to resolve 2017-02-20 19:56:07 -05:00
Andrew Kelley c4ee37f506 fix assertion failure when first use of a struct is sizeOf 2017-02-18 18:33:21 -05:00
Andrew Kelley 0148f39df9 pointers with bit offset contain length
adds compile error when passing pointer that is byte-aligned
at the beginning but not the end to a function expecting
a fully byte aligned pointer

closes #261
2017-02-16 19:35:42 -05:00
Andrew Kelley 244362fed7 ability to write to bit fields
See #261
2017-02-16 18:42:52 -05:00
Andrew Kelley b6e7a0dadd support arithmetic for non byte aligned integer types
see #261
2017-02-16 17:08:55 -05:00
Andrew Kelley fc5d47b9b9 reading from a bit field partially works
See #261

Still need to do:
 * reading a field that has bit offset 0 but still needs to
   shift and truncate
 * writing a field
2017-02-16 15:45:41 -05:00
Andrew Kelley 4b5cc80f66 move volatile pointers to central type table 2017-02-16 13:58:42 -05:00
Andrew Kelley 4a957b9ea3 move int and array types to central table 2017-02-16 13:45:14 -05:00
Andrew Kelley 1fc2082b4c ability to declare const bitfields
See #261
2017-02-15 18:55:29 -05:00
Andrew Kelley 63d37b7cff add runtime debug safety for dividing integer min value by -1
closes #260
2017-02-14 01:08:30 -05:00
Andrew Kelley 0931b85bd0 fix crash when return value is ??void
closes #258
2017-02-12 18:27:34 -05:00
Andrew Kelley 79ec5a0287 fix tokenization assertion failure on some float numbers
See #258
2017-02-12 17:56:34 -05:00
Andrew Kelley b61f1a9f7d printf: only include + sign on signed ints if width specified
see #258
2017-02-12 17:46:28 -05:00
Andrew Kelley 6dba1f1c8e slice and array re-work plus some misc. changes
* `@truncate` builtin allows casting to the same size integer.
   It also performs two's complement casting between signed and
   unsigned integers.
 * The idiomatic way to convert between bytes and numbers is now
   `mem.readInt` and `mem.writeInt` instead of an unsafe cast.
   It works at compile time, is safer, and looks cleaner.
 * Implicitly casting an array to a slice is allowed only if the
   slice is const.
 * Constant pointer values know if their memory is from a compile-
   time constant value or a compile-time variable.
 * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T
   still allowed.
 * Fix inability to pass a mutable pointer to comptime variable at
   compile-time to a function and have the function modify the
   memory pointed to by the pointer.
 * Add the `comptime T: type` parameter back to mem.eql. Prevents
   accidentally creating instantiations for arrays.
2017-02-12 17:35:51 -05:00