aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
AgeCommit message (Collapse)Author
2019-02-04fix vector debug info tripping LLVM assertionAndrew Kelley
2019-02-04SIMD: array to vector, vector to array, wrapping int addAndrew Kelley
also vectors and arrays now use the same ConstExprVal representation See #903
2019-01-30introduce vector type for SIMDAndrew Kelley
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-29backport copy elision changesAndrew Kelley
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-20src/analyze.cpp: return type entry for `ZigTypeIdPointer` if it points to ↵kristopher tate
`ZigTypeIdOpaque` ref: ziglang/zig#1883
2019-01-09when rendering llvm const values, ensure the types alignAndrew Kelley
the representation of the const expr val in zig, and the type that we tell LLVM it is.
2019-01-08fix debug info for function pointersAndrew Kelley
found when testing against LLVM 8 see https://bugs.llvm.org/show_bug.cgi?id=40198
2019-01-02@bitreverse intrinsic, part of #767 (#1865)vegecode
* 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
2018-12-29Merge pull request #1859 from mgxm/fbsd2Andrew Kelley
Progress towards tier 1 support for FreeBSD x86_64
2018-12-26allow not having libc include paths and doing @cImportAndrew Kelley
2018-12-26fixupsAndrew Kelley
2018-12-23msvc subsystem option handling; added uefi os typenebulaeonline
2018-12-23Merge branch 'master' into fbsd2Marcio Giaxa
2018-12-20fixupsAndrew Kelley
2018-12-20src/analyze.cpp: support alignOf(struct T) aligned member inside struct T;kristopher tate
ref: ziglang/zig#1832
2018-12-19freebsd: link against libcMarcio Giaxa
Since the stable kernel ABI is through libc #1759
2018-12-12breaking API changes to all readInt/writeInt functions & moreAndrew Kelley
* add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-11-27Merge branch 'master' into freebsd2Andrew Kelley
2018-11-24refactor type_requires_comptime to have possible errorAndrew Kelley
fixes a compiler crash when building https://github.com/AndreaOrru/zen
2018-11-19Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2Andrew Kelley
2018-11-17aarch64 improvementsAndrew Kelley
* support C ABI for all return types * don't include __aeabi_uldivmod & co on aarch64 since it's 64 bit
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-09array type syntax implies comptimeAndrew Kelley
2018-11-06macos: use the same code as linux to determine libc include pathAndrew Kelley
this fixes .h file locating on macos 10.14
2018-11-06limit integer types to maximum bit width of 65535Andrew Kelley
closes #1541
2018-10-20Set up libc/rtld paths for FreeBSDGreg V
2018-10-13fix compiler crashAndrew Kelley
2018-10-13C ABI and compiler rt improvements for ARMAndrew Kelley
* add __multi3 compiler rt function. See #1290 * compiler rt includes ARM functions for thumb and aarch64 and other sub-arches left out. See #1526 * support C ABI for returning structs on ARM. see #1481
2018-10-04refactor ir.cppAndrew Kelley
Analysis functions no longer return `ZigType *`. Instead they return `IrInstruction *`.
2018-10-01Fixed StackTrace not being resolved when panic is invalid (#1615)Jimmi Holst Christensen
2018-10-01std lib: flesh out the async I/O streaming API a bitAndrew Kelley
2018-09-26fix crash when compile error evaluating return...Andrew Kelley
...type of inferred error set. closes #1591
2018-09-26fix variables which are pointers to packed struct fieldsAndrew Kelley
closes #1121
2018-09-26the last number in a packed ptr is host int bytesAndrew Kelley
See #1121
2018-09-25fix crash on runtime index into slice of comptime typeAndrew Kelley
closes #1435
2018-09-25fix self reference through fn ptr field crashAndrew Kelley
closes #1208
2018-09-20better string literal caching implementationAndrew Kelley
We were caching the ConstExprValue of string literals, which works if you can never modify ConstExprValues. This premise is broken with `comptime var ...`. So I implemented an optimization in ConstExprValue arrays, where it stores a `Buf *` directly rather than an array of ConstExprValues for the elements, and then similar to array of undefined, it is expanded into the canonical form when necessary. However many operations can happen directly on the `Buf *`, which is faster. Furthermore, before a ConstExprValue array is expanded into canonical form, it removes itself from the string literal cache. This fixes the issue, because before an array element is modified it would have to be expanded. closes #1076
2018-09-18fix optional pointer to empty struct incorrectly being non-nullAndrew Kelley
closes #1178
2018-09-17allow extern structs to have stdcallcc function pointersAndrew Kelley
closes #1536
2018-09-16fix crash when pointer casting a runtime extern functionAndrew Kelley
2018-09-14fix alignment of structsAndrew Kelley
closes #1248 closes #1052 closes #1154
2018-09-14fix coroutine alignmentAndrew Kelley
zig returned the wrong alignment for coroutine promises in some cases
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-09-13add compile error for merging non- error setsAndrew Kelley
closes #1509
2018-09-13fix tagged union with only 1 field tripping assertionAndrew Kelley
closes #1495 now the tag type of an enum with only 1 item is comptime_int.
2018-09-11error messages for attempted cache when zig cannot perfectly do itAndrew Kelley
2018-09-11Merge remote-tracking branch 'origin/master' into stage1-cachingAndrew Kelley
2018-09-11fix incorrect error union const value generationAndrew Kelley
closes #1442 zig needed to insert explicit padding into this structure before it got bitcasted.
2018-09-11ability to disable cache. off by default except for...Andrew Kelley
...zig run, zig build, compiler_rt.a, and builtin.a
2018-09-10fix llvm assertion and missing compile errorAndrew Kelley