aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
AgeCommit message (Collapse)Author
2020-06-23Add duplicate checking for switch on typesantlilja
* Add compile error tests
2020-06-21stage1: fix concat of sliced str literalsxackus
2020-06-21Make unary minus for unsigned types a compile error (#5654)Robin Voetter
* Make unary minus for unsigned types a compile error * Add unreachable when generating unsigned negate
2020-06-18Merge pull request #5203 from tadeokondrak/@type-for-even-more-typesAndrew Kelley
implement @typeInfo for Frame and implement @Type for Frame, EnumLiteral, and ErrorSet
2020-06-18Merge pull request #5625 from antlilja/masterAndrew Kelley
Improve support for f128 and comptime_float operations
2020-06-18make file and fn_name fields of SourceLocation also null-terminatedAndrew Kelley
One of the main motivating use cases for this language feature is tracing/profiling tools, which expect null-terminated strings for these values. Since the data is statically allocated, making them additionally null-terminated comes at no cost. This prevents the requirement of compile-time code to convert to null-termination, which could increase the compilation time of code with tracing enabled. See #2029
2020-06-18implement `@src`Vexu
2020-06-17Improve builtin op support for f128/comptime_floatantlilja
* Add support for fabs, floor, ceil, trunc and round * Add behavior tests
2020-06-16Remove obsolete branch in ir_analyze_castJakub Konka
Branch handling `*[N]T` to `E![]T` is already handled in a more complete branch handling `*[N]T` to `[]T` *and* `*[N]T` to `E![]T` so it seems safe to remove this one.
2020-06-15stage1: implement type coercion of anon struct literal to structAndrew Kelley
closes #3672
2020-06-09Return u32 in @wasmMemorySize instead of i32Jakub Konka
2020-06-09Return should be i32 due to error signaling in memory.growJakub Konka
Also, fix tests.
2020-06-09Fix builtins to return and accept u32 instead of i32Jakub Konka
2020-06-09Expose full llvm intrinsicJakub Konka
2020-06-09Add builtin for llvm.wasm.memory.grow.i32 intrinsicJakub Konka
This will allow the developer to request additional memory pages from the runtime to be allocated for the Wasm app. Typical usage: ```zig var wasm_pages = @wasmMemorySize(); @wasmMemoryGrow(1); @import("std").debug.assert((wasm_pages + 1) == @wasmMemorySize()); ```
2020-06-09Add builtin for llvm.wasm.memory.size.i32 instrinsicJakub Konka
This will allow the developer to poll the runtime for currently allocated memory in the number of Wasm pages. Typical usage: ```zig var wasm_pages = @wasmMemorySize(); @import("std").debug.assert(wasm_pages > 0); ```
2020-06-09Merge pull request #5539 from mikdusan/issue5474Andrew Kelley
stage1: fix constness in some corner cases
2020-06-08stage1: fix crash on slice byte reinterpretationxackus
2020-06-05stage1: fix constness in some corner casesMichael Dusan
- for one-possible-value types, ir_analyze_struct_field_ptr() no longer hardcodes const/volatile - when slicing arrays, ir_analyze_instruction_slice() no longer consults ConstValSpecialStatic closes #5474
2020-05-31stage1: fix unresolved inferred error setsxackus
2020-05-29Support equality comparison for optional to non-optional (?T ==/!= T)foobles
extracted function ir_try_evaluate_bin_op_const extracted type_is_self_comparable function renamed ir_try_evaluate_bin_op_const to ir_try_evaluate_bin_op_cmp_const implemented analysis of ?T == T added ir_set_cursor_at_end_and_append_basic_block_gen use build_br_gen and ir_set_cursor_at_end_and_append_block_gen added ir_append_basic_block_gen removed include of all_types in ir.cpp extracted compile-time and runtime evaluation of cmp_optional_non_optional to separate functions closes #5390 closes #1332
2020-05-30Merge pull request #5184 from alexnask/typeof_extern_callVeikka Tuominen
Extern functions are now evaluated to undefined values at comptime in TypeOf calls.
2020-05-26Add caller location tracking for asserts (ir_assert, src_assert, ↵foobles
ir_assert_gen) (#5393)
2020-05-23fix regression in compile errorsAndrew Kelley
2020-05-20stage1: fix false positive redeclared variable compile errorAndrew Kelley
2020-05-18Add TypeOf resolution of dereferences and struct fields of undefined valuesAlexandros Naskos
2020-05-17Merge pull request #5057 from xackus/opaque-paramAndrew Kelley
stage1: fix assert fail on opaque fn ptr param
2020-05-12fix `@intToFloat` on comptime_floatsVexu
2020-05-08Merge pull request #4932 from Qix-/fix-private-accessVexu
Fix private access
2020-05-08fix private member checking for non-canonical invocations (fixes #4909)Josh Junon
2020-05-07stage1: handle all cases of invalid struct field default valuexackus
2020-05-05Merge pull request #5272 from tadeokondrak/noasync-to-nosuspendAndrew Kelley
Noasync to nosuspend
2020-05-05Rename noasync to nosuspend in C++ compilerTadeo Kondrak
2020-05-04Merge pull request #5267 from Vexu/const-callVexu
Fix missing compile error on call assigned to const
2020-05-04fix missing compile error on call assigned to constVexu
2020-05-04stage1: fix assert fail on opaque fn ptr paramxackus
2020-05-02Implement @Type for ErrorSetTadeo Kondrak
2020-05-02Implement @Type() for EnumLiteral and FnFrameTadeo Kondrak
2020-05-02Implement @typeInfo for @Frame()Tadeo Kondrak
Closes https://github.com/ziglang/zig/issues/3066
2020-05-01stage1: cleanupMichael Dusan
- remove unused IrInstSrcOptionalUnwrapPtr.initializing
2020-04-28Validate vector types for @VectorTadeo Kondrak
2020-04-27implement @Type() for more typesTadeo Kondrak
2020-04-27Cleaned up code, added a testcase for an extern member function callAlexandros Naskos
2020-04-27Added tests.Alexandros Naskos
2020-04-27Extern functions can now be evaluated to undefined values in TypeOfsAlexandros Naskos
2020-04-24stage1: Prevent the creation of illegal ptr typesLemonBoy
Closes #5140
2020-04-23stage1: fix crash on accessing an array of size zero with runtime indexxackus
2020-04-23stage1: Fix bitcast of immediate to ptr type (#5131)LemonBoy
Consider a (legal according to the `@bitCast` rules) conversion from u16 to [2]u8: since the former is a scalar and the latter is a pointer (arrays are represented at pointers in the codegen phase) we have to allocate a temporary slot on the stack and then bitcast the resulting pointer to the desired destination type. Beware that this means the lifetime of the resulting value is the same of the function it's contained in and for all intents and purposes should be regarded as a local (eg. it should not escape). Closes #4395 Closes #5121
2020-04-22Merge pull request #5130 from ziglang/stage2-irAndrew Kelley
beginnings of non-LLVM self-hosted backend
2020-04-22stage1: Prevent the creation of illegal pointer typesLemonBoy
Changing the pointer length from Unknown to Single/C now resets the sentinel value too. Closes #5134