aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
AgeCommit message (Collapse)Author
2018-06-28Implement const_values_equal for array typeJimmi HC
* This allows arrays to be passed by value at comptime
2018-06-27fix coroutine accessing freed memoryAndrew Kelley
closes #1164
2018-06-27fix comptime @tagName crashing sometimesAndrew Kelley
closes #1118
2018-06-27add f16 typeBen Noordhuis
Add support for half-precision floating point operations. Introduce `__extendhfsf2` and `__truncsfhf2` in std/special/compiler_rt. Add `__gnu_h2f_ieee` and `__gnu_f2h_ieee` as aliases that are used in Windows builds. The logic in std/special/compiler_rt/extendXfYf2.zig has been reworked and can now operate on 16 bits floating point types. `extendXfYf2()` and `truncXfYf2()` are marked `inline` to work around a not entirely understood stack alignment issue on Windows when calling the f16 versions of the builtins. closes #1122
2018-06-26rename get_maybe_type to get_optional_typeAndrew Kelley
2018-06-21fix compiler crash for invalid enumAndrew Kelley
closes #1079 closes #1147
2018-06-19fix calling method with comptime pass-by-non-copyign-value self argAndrew Kelley
closes #1124
2018-06-18disallow opaque as a return type of fn type syntaxAndrew Kelley
closes #1115
2018-06-16allow passing by non-copying valueAndrew Kelley
closes #733
2018-06-14Enabled optional types of zero bit types with no LLVM DI type. (#1110)Alexandros Naskos
* Zero bit optional types do not need a LLVM DI type
2018-06-10breaking syntax change: orelse keyword instead of ?? (#1096)Andrew Kelley
use the `zig-fmt-optional-default` branch to have zig fmt automatically do the changes. closes #1023
2018-06-09breaking syntax change: ??x to x.? (#1095)Andrew Kelley
See #1023 This also renames Nullable/Maybe to Optional
2018-06-09nullable pointers follow const-casting rulesAndrew Kelley
any *T -> ?*T cast is allowed implicitly, even when it occurs deep inside the type, and the cast is a no-op at runtime. in order to add this I had to make the comptime value representation of nullable pointers the same as the comptime value representation of normal pointers, so that we don't have to do any recursive transformation of values when doing this kind of cast.
2018-06-08Allow access of array.len through a pointerJimmi HC
2018-06-07fix structs that contain types which require comptimeAndrew Kelley
Now, if a struct has any fields which require comptime, such as `type`, then the struct is marked as requiring comptime as well. Same goes for unions. This means that a function will implicitly be called at comptime if the return type is a struct which contains a field of type `type`. closes #586
2018-06-06Pointer Reform: update @typeInfoAndrew Kelley
* add assertion for trying to do @typeInfo on global error set * remove TypeInfo.Slice * add TypeInfo.Pointer.Size with possible values - One - Many - Slice See #770
2018-06-05disable field access for unknown length pointersAndrew Kelley
See #770
2018-06-05disallow unknown-length pointer to opaqueAndrew Kelley
This also means that translate-c has to detect when a pointer to opaque is happening, and use `*` instead of `[*]`. See #1059
2018-06-05fix crash when evaluating return type has compile errorAndrew Kelley
closes #1058
2018-06-05Renamed UndefinedLiteral to UndefinedJimmi HC
2018-06-05Removed NullLiteral to NullJimmi HC
2018-06-05Renamed "(int/float literal)" to "comptime_int/float"Jimmi HC
2018-06-04Pointer Reform: proper slicing and indexing (#1053)Andrew Kelley
* enable slicing for single-item ptr to arrays * disable slicing for other single-item pointers * enable indexing for single-item ptr to arrays * disable indexing for other single-item pointers see #770 closes #386
2018-06-04never call malloc with size 0Andrew Kelley
instead we return nullptr. this makes the behavior consistent across all platforms. closes #1044 closes #1045
2018-06-04disallow single-item pointer indexingAndrew Kelley
add pointer arithmetic for unknown length pointer
2018-05-31use * for pointer type instead of &Andrew Kelley
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
2018-05-30Removed copy-pasted resolve_inferred_error_setJimmi HC
both ir.cpp and analyze.cpp have a function resolve_inferred_error_set, which is a nearly exact copy-paste. This commit removes the one in ir.cpp and exposes then one in analyze.cpp. This also allows us to make analyze_fn_body local to analyze.cpp, as it is not used anywhere in ir.cpp after this change
2018-05-24update github.com/zig-lang to github.com/ziglangAndrew Kelley
2018-05-09Merge branch 'master' into pointer-reformAndrew Kelley
2018-05-09Added Slice as it's own type info in userlandJimmi HC
2018-05-03Fixed extern enums having the wrong size (#970)Jimmi Holst Christensen
Fixed extern enums having the wrong size See #977
2018-04-30support foo.* for ptr derefAndrew Kelley
See #770
2018-04-28Using allocate instead of allocate_nonzero so we don't have to memsetJimmi Holst Christensen
2018-04-28Fixed build errorJimmi Holst Christensen
2018-04-28Trying to fix osx build failing by setting param_info.type to nullptrJimmi Holst Christensen
2018-04-28Functions with infered error set can now return literalsJimmi Holst Christensen
fixes #852
2018-04-22exit(1) instead of abort() for file not foundAndrew Kelley
2018-04-22better error reporting for missing libc on windowsAndrew Kelley
closes #931
2018-04-18support break in suspend blocksAndrew Kelley
* you can label suspend blocks * labeled break supports suspend blocks See #803
2018-04-16fix windows not respecting --msvc-lib-dir, --kernel32-lib-dirAndrew Kelley
I believe this was a regression caused by 51a6ff18d454f4cb0faa0f1837df9f0c55a80b43 closes #927
2018-04-15add @sqrt built-in functionAndrew Kelley
See #767
2018-04-08*WIP* async/await TCP serverAndrew Kelley
2018-04-08error return traces work with async return caseAndrew Kelley
2018-04-08put the error return addresses in the coro frameAndrew Kelley
2018-04-08error return traces for the early return caseAndrew Kelley
it would work but LLVM is not correctly spilling the addresses. See #821
2018-03-31fix regressions on windowsAndrew Kelley
2018-03-30find libc and zig std lib at runtimeAndrew Kelley
this removes the following configure options: * ZIG_LIBC_LIB_DIR * ZIG_LIBC_STATIC_LIB_DIR * ZIG_LIBC_INCLUDE_DIR * ZIG_DYNAMIC_LINKER * ZIG_EACH_LIB_RPATH * zig's reliance on CMAKE_INSTALL_PREFIX these options are still available as command line options, however, the default will attempt to execute the system's C compiler to collect system defaults for these values. closes #870
2018-03-29Fixed looking for windows sdk when targeting linuxJimmi Holst Christensen
2018-03-24fix invalid codegen for error return traces across suspend pointsAndrew Kelley
See #821 Now the code works correctly, but error return traces are missing the frames from coroutines.
2018-03-24add promise->T syntax parsingAndrew Kelley
closes #857