Commit Graph

2253 Commits

Author SHA1 Message Date
Andrew Kelley
a94304d3e4
Merge remote-tracking branch 'origin/master' into llvm8 2019-02-07 12:21:20 -05:00
Andrew Kelley
2b2bf53a49
better error message when LLVM does not understand a triple 2019-02-07 11:40:56 -05:00
Andrew Kelley
8a5d3e2eaf
Merge pull request #1924 from ziglang/tls
Implement Thread Local Variables
2019-02-06 20:21:13 -05:00
Andrew Kelley
89ffb58197 implement Thread Local Storage on Windows 2019-02-06 18:32:41 -05:00
Andrew Kelley
d2602b442e
require running std lib tests coherently
this should actually improve CI times a bit too

See the description at the top of std/os/startup.zig (deleted in this
commit) for a more detailed understanding of what this commit does.
2019-02-06 14:32:20 -05:00
Andrew Kelley
b1775ca168
thread local storage working for linux x86_64 2019-02-06 13:48:04 -05:00
Jimmi Holst Christensen
4010f6a11d Added support for vector wrapping mult and sub
* I also merged the code that generates ir for add, sub, and mult
2019-02-05 09:57:11 -05:00
Andrew Kelley
06be65a602
fix vector debug info tripping LLVM assertion 2019-02-04 22:16:16 -05:00
Andrew Kelley
d974afde1d
fix vector debug info tripping LLVM assertion 2019-02-04 22:14:35 -05:00
Andrew Kelley
f32f7a937f
Merge remote-tracking branch 'origin/master' into llvm8 2019-02-04 21:26:50 -05:00
Andrew Kelley
8c6fa982cd
SIMD: array to vector, vector to array, wrapping int add
also vectors and arrays now use the same ConstExprVal representation

See #903
2019-02-04 20:30:00 -05:00
Matthew McAllister
c90c256868 Fix slice concatenation
This was causing an underflow error
2019-02-02 22:22:00 -05:00
Andrew Kelley
9b8e23934b
introduce --single-threaded build option
closes #1764

This adds another boolean to the test matrix; hopefully it does not
inflate the time too much.

std.event.Loop does not work with this option yet. See #1908
2019-02-01 18:05:54 -05:00
Matthew McAllister
8bedb10939 Fix runtime assignment to comptime aggregate field
This was causing a segfault
2019-02-01 17:14:12 -05:00
Andrew Kelley
ae1ebe09b7
add compile errror for @bitCast when bit counts mismatch
fixes invalid LLVM IR from previous commit
2019-02-01 14:06:51 -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
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
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
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
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
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
Jimmi HC
da08525bb3 Removed oops comments 2019-01-06 18:02: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
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
vegecode
f6cd68386d @bitreverse intrinsic, part of #767 (#1865)
* bitreverse - give bswap behavior

* bitreverse, comptime_ints, negative values still not working?

* bitreverse working for negative comptime ints

* Finished bitreverse test cases

* Undo exporting a bigint function. @bitreverse test name includes ampersand

* added docs entry for @bitreverse
2019-01-02 16:47:47 -05:00
Andrew Kelley
036a49e97d Merge remote-tracking branch 'origin/master' into llvm8 2019-01-01 18:36:12 -05:00
alexander
6df8e4bca7 Add DIFlagStaticMember flag to functions.
Prevents LLVM from generating debug info for
struct member functions with a pointer as the
first parameter as though the first parameter
were the implicit "this" pointer from C++.
2018-12-30 12:57:49 -05:00
Andrew Kelley
d8b6fa9134
Merge pull request #1859 from mgxm/fbsd2
Progress towards tier 1 support for FreeBSD x86_64
2018-12-29 12:49:23 -05:00
Andrew Kelley
c464ecf3bf
Merge pull request #1857 from vegecode/boolean-switch
Switching on bools with duplicate and missing value detection: Issue …
2018-12-27 18:14:33 -05:00
Andrew Kelley
aaef6259c3
allow not having libc include paths and doing @cImport 2018-12-26 20:44:06 -05:00
Andrew Kelley
a918ce26b8
fixups 2018-12-26 15:25:54 -05:00
alexander
4a1f0e1418 Switching on bools with duplicate and missing value detection: Issue 1768 2018-12-26 10:44:25 -06:00
nebulaeonline
f49b45b00f tabs to space fix. thanks visual studio. 2018-12-24 14:01:35 -05:00
nebulaeonline
28cd337d1f fixed formatting in options display 2018-12-24 07:49:15 -05:00
nebulaeonline
7dcee99510 fixed stricmp/strcasecmp between windows/posix 2018-12-23 23:59:59 -05:00
nebulaeonline
51baea184b Yet another git user error remnant fixed 2018-12-23 23:46:45 -05:00
nebulaeonline
480061d2c9 git user error fix 2018-12-23 23:09:07 -05:00
nebulaeonline
fdea12b2d9 msvc subsystem option handling; added uefi os type 2018-12-23 22:44:02 -05:00