Commit Graph

4753 Commits (8ce130de3cf38e09cfbcbd1b22da34ae5b27a040)

Author SHA1 Message Date
Andrew Kelley 8d3eb25e92 Merge branch 'windows-mutex' of https://github.com/emekoi/zig into emekoi-windows-mutex 2019-02-01 10:21:16 -05:00
Andrew Kelley 7a4ed10981 darwin: fix incorrect timeval struct type
closes #1648

I also added some more extern functions for darwin time functions,
although nothing depends on them currently.
2019-01-31 18:57:53 -05:00
Andrew Kelley 28873e7622 os.cpp: fix regression on Windows from 59c050e7 2019-01-31 16:52:59 -05:00
Andrew Kelley 545064c1d9
introduce vector type for SIMD
See #903

 * create with `@Vector(len, ElemType)`
 * only wrapping addition is implemented

This feature is far from complete; this is only the beginning.
2019-01-30 23:39:25 -05:00
Andrew Kelley 169a789b34
fix test after merging ad8381e0d2
this test slipped through due to branching
2019-01-30 16:12:30 -05:00
Andrew Kelley 59c050e7ff
collapse os_file_mtime into os_file_open_r and check for directory
This is a manual merge of kristate's pull request #1754, due to
conflicts + a couple fixups.

closes #1754
2019-01-30 16:06:18 -05:00
Matthew McAllister ad8381e0d2 Move tokenizer error location to offending char
Previously, it pointed to the start of the current token, but this made
it difficult to tell where the error occurred when it was, say, in the
middle of a string.
2019-01-30 14:02:01 -05:00
Andrew Kelley ecb0cb661a
darwin time code: don't cast to int until the end
See #1648
2019-01-30 02:53:59 -05:00
Andrew Kelley 9ca94bbba5
fix freebsd ci from previous commit 2019-01-30 02:53:50 -05:00
Andrew Kelley 581edd643f
backport copy elision changes
This commit contains everything from the copy-elision-2
branch that does not have to do with copy elision directly,
but is generally useful for master branch.

 * All const values know their parents, when applicable, not
   just structs and unions.
 * Null pointers in const values are represented explicitly,
   rather than as a HardCodedAddr value of 0.
 * Rename "maybe" to "optional" in various code locations.
 * Separate DeclVarSrc and DeclVarGen
 * Separate PtrCastSrc and PtrCastGen
 * Separate CmpxchgSrc and CmpxchgGen
 * Represent optional error set as an integer, using the 0 value.
   In a const value, it uses nullptr.
 * Introduce type_has_one_possible_value and use it where applicable.
 * Fix debug builds not setting memory to 0xaa when storing
   undefined.
 * Separate the type of a variable from the const value of a variable.
 * Use copy_const_val where appropriate.
 * Rearrange structs to pack data more efficiently.
 * Move test/cases/* to test/behavior/*
 * Use `std.debug.assertOrPanic` in behavior tests instead of
   `std.debug.assert`.
 * Fix outdated slice syntax in docs.
2019-01-29 22:30:30 -05:00
Andrew Kelley 9c328b4291
simpler implementation of `&&` and `||` hints
This accomplishes the same goal, but with less changes, so that
I can backport copy elision stuff easier.
2019-01-29 22:29:56 -05:00
Sahnvour f0d35d78b6 translate-c: avoid array concatenation if the init node is empty, for clarity. 2019-01-26 16:47:11 +01:00
Sahnvour 584cb1fcfe translate-c: only detect ints as negative if they are signed. 2019-01-26 15:53:19 +01:00
Sahnvour b2662e443d translate-c: correct array concatenation for incomplete C array initializers. 2019-01-26 15:41:23 +01:00
Sahnvour dd5450e7b9 translate-c: get real child type of array type for incomplete initializers and/or multi-dimensional arrays. 2019-01-26 15:39:38 +01:00
kristopher tate 5bf9ffdc5b Hint at use of and/or when &&/|| is improperly used (#1886) 2019-01-25 21:10:40 +01:00
Andrew Kelley 1411df4e27 update to llvm8 trunk. all tests passing 2019-01-24 09:31:00 -05:00
Andrew Kelley 87f5bed11f Merge remote-tracking branch 'origin/master' into llvm8 2019-01-22 20:10:34 -05:00
tharvik 3bec3b9f9b llvm-config sanity check 2019-01-21 15:58:54 -05:00
Andrew Kelley aee973829d
Merge branch 'kristate-zig-backport-issue1883' 2019-01-20 14:09:46 -05:00
Andrew Kelley 1357bc7430
add test case for previous commit 2019-01-20 14:09:17 -05:00
kristopher tate 0d1ce1fb5f
src/analyze.cpp: return type entry for `ZigTypeIdPointer` if it points to `ZigTypeIdOpaque`
ref: ziglang/zig#1883
2019-01-20 17:08:35 +09:00
Andrew Kelley c968d8756c
Merge pull request #1885 from Sahnvour/master
Fixed source lines printing of stack traces on windows.
2019-01-18 13:32:01 -05:00
Sahnvour a60ecdc681 Hopefully fixed #1503 (at least improved) line accuracy of stack traces on windows. 2019-01-18 10:35:00 +01:00
Sahnvour 5ab8db7b3e removed unnecessary cast 2019-01-18 10:35:00 +01:00
Andrew Kelley 404c87b06a
fix incorrect parameter names for std.math.atan2 2019-01-14 18:11:17 -05:00
emekoi 3ff9ab332c fixed type signature 2019-01-11 09:56:37 -06:00
emekoi 51fff9fa82 fixed initializer and typos 2019-01-11 09:56:36 -06:00
emekoi 35d93d22db removed nullables 2019-01-11 09:56:36 -06:00
emekoi 9385127052 changed pointer types 2019-01-11 09:56:35 -06:00
emekoi bb31695fbf fixed mutex on windows 2019-01-11 09:56:35 -06:00
emekoi 207fa3849c moved to InitializeCriticalSection to init 2019-01-11 09:56:34 -06:00
emekoi 25d7f5b654 switching back to EnterCriticalSection 2019-01-11 09:56:34 -06:00
emekoi aaae2f5705 switching from EnterCriticalSection to TryEnterCriticalSection 2019-01-11 09:56:33 -06:00
emekoi 99f44219bc updated structs 2019-01-11 09:56:33 -06:00
emekoi b61bce254c added mutex for windows 2019-01-11 09:56:32 -06:00
Andrew Kelley 3b2eeb839b Merge remote-tracking branch 'origin/master' into llvm8 2019-01-09 10:44:57 -05:00
Andrew Kelley 5864d92b40
when rendering llvm const values, ensure the types align
the representation of the const expr val in zig, and the
type that we tell LLVM it is.
2019-01-09 10:43:48 -05:00
Andrew Kelley 027a0c46ae Merge remote-tracking branch 'origin/master' into llvm8 2019-01-08 16:50:16 -05:00
Andrew Kelley 1ca983dbd7 translate-c: update to llvm8 2019-01-08 16:49:52 -05:00
Andrew Kelley 4d5d0d3ada
`@typeInfo`: more correct return type info 2019-01-08 14:40:56 -05:00
Andrew Kelley aa65b94671
fix debug info for function pointers
found when testing against LLVM 8

see https://bugs.llvm.org/show_bug.cgi?id=40198
2019-01-08 11:53:51 -05:00
Andrew Kelley 013c7b24d2
Merge pull request #1874 from ziglang/issue-1866
Fix #1866
2019-01-06 14:00:34 -05:00
Jimmi HC da08525bb3 Removed oops comments 2019-01-06 18:02:00 +01:00
Jimmi HC 97702988d1 Added test case 2019-01-06 17:58:00 +01:00
Jimmi HC 55e95daf54 Fixed issue where TypeInfo would use types from a prev CodeGen instance
When doing multible codegen passes (such as building
compiler_rt and then something else) the TypeInfo cache code would point
to types from the prev code gen (such as the prev 'bool' type), giving
us errors like "expected type 'bool', but found type 'bool'"
This disabling of caching might have a performance hit, but correctness is better than
speed, so let's have this for now, until someone optimizes this
correctly (probably in stage2)
2019-01-06 17:53:34 +01:00
Jimmi HC e410b1f915 Implemented buf_read_value_bytes for ZigTypeIdArray
* Only for x_array.special == ConstArraySpecialNone
2019-01-06 17:49:24 +01:00
Jimmi HC db92891587 Respect the type system instead of ConstExprValue when getting field 2019-01-06 17:48:31 +01:00
Marcio 5f26d1dddb freebsd: fix wrong call to clock_getres (#1871)
Reported-by: daurnimator
2019-01-05 13:34:47 -05:00
vegecode 1f08be4d7f Mark comptime int hardcoded address pointee as a run time variable #1171 (#1868)
* Mark comptime int hardcoded address as a run time variable #1171

* test case for dereferencing hardcoded address intToPtr
2019-01-04 17:34:21 -05:00