aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
AgeCommit message (Collapse)Author
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-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
2020-04-21ir: analyze int castingAndrew Kelley
2020-04-21Added peer type resolution for [*]T and *[N]T.elucent
2020-04-21cleanup: IrBasicBlockGenMichael Dusan
remove unused param from `ir_ref_inst_gen`
2020-04-21cleanup: IrBasicBlockGenMichael Dusan
remove unused members { parent, index, ref_count }
2020-04-20stage1: Handle errors when generating block IRLemonBoy
Closes #5005
2020-04-19fix uninitialized ZigValuexackus
2020-04-18fix typeInfo testsVexu
2020-04-17add error for non-exter variadic functionsVexu
2020-04-17fix missing compile errors on builtin cast functionsVexu
2020-04-14Shift error message now says "fixed-width integer type" instead of just ↵foobles
"integer type" (#5028) * error message of ir_analyze_bit_shift now more accurate/specific * fixed compile error test to match bit shift error message
2020-04-09add error message for invalid assignmentVexu
2020-04-08Merge pull request #4975 from Vexu/param-reassignAndrew Kelley
Fix missing compile error on assign to slice and array parameters