aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
AgeCommit message (Collapse)Author
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
2020-04-08fix formatted printing warningAndrew Kelley
needed to use ZIG_PRI_u64 instead of %lu
2020-04-08move array and struct const checks to more appropriate placesVexu
2020-04-07fix lazy value in ir_analyze_instruction_elem_ptrxackus
2020-04-08fix missing compile error on assign to slice and array parametersVexu
2020-04-07fix missing const on address of literalVexu
2020-04-06ir: Support tuple multiplicationLemonBoy
2020-04-05ir: Support shift left/right on vectorsLemonBoy
2020-04-05ir: Support bitwise not on vectorsLemonBoy
2020-04-05ir: Support div/mod/rem on vector typesLemonBoy
Closes #4050
2020-04-04stage1: Byteswap floats when serializing themLemonBoy
2020-04-04stage1: Fix serialization of ZigValue on BE machinesLemonBoy
2020-04-03stage1: add compile errors for sentinel slicingMichael Dusan
closes #3963
2020-04-01zig cc properly handles -S flag and .ll, .bc extensionsAndrew Kelley
2020-04-01ir: Fix comparison of ?T valuesLemonBoy
The code assumed that every ?T had a pointer child type T, add some more checks to make sure the type is effectively a pointer. Closes #4789
2020-04-01stage1: make C++ switch fallthrough an errorMichael Dusan
Make fallthrough an error when compiler supports it. This requires a new macro that is defined with such compilers to be used as a statement, at all fallthrough sites: switch (...) { case 0: ... ZIG_FALLTHROUGH; case 1: ... break; default: ... break; } If we ever move to C++17 as minimal requirement, then the macro can be replaced with `[[fallthrough]];` at statement sites.
2020-04-01Make sure that ZigTypeVector and ZigTypeArray have the same memory layoutTimon Kruiper
Throughout the stage1 code it is assumed that these have the same layout, but that was not the case. This caused an issue on 32-bit hardware.
2020-04-01Fix some nullptr dereferences on arm-linux-musleabhifTimon Kruiper
2020-03-30add peer type resolution for mixed-const []T and *[N]TAndrew Kelley
closes #4766 This commit also fixes the implementation of some utility functions for adjusting properties of pointer types. Previously these functions would incorrectly drop vector, sentinel, and inference metadata.
2020-03-30ir: Avoid constant-folding ptr to sentinelsLemonBoy
Constant-folding the pointers to the expected sentinel value have some big problems: it hides the real content of the array, makes the pointer to the sentinel point to a completely different memory region and treats it like a const value even when the underlying array is mutable. Fixes #4840
2020-03-26fix behavior tests compile error on i386-linuxAndrew Kelley
2020-03-26prevent ptr cast from forcing alignment resolution unnecessarilyAndrew Kelley
2020-03-25fix an invalid free having to do with bound functionsAndrew Kelley
this should fix the drone CI failure
2020-03-24Merge remote-tracking branch 'origin/llvm10'Andrew Kelley
LLVM 10 was released today
2020-03-23ir: Prevent crash when slicing hardcoded pointerLemonBoy
Closes #4780
2020-03-22riscv: add -mrelax arg for C to work around upstream issueAndrew Kelley
See #4485
2020-03-22Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-22ir: Implement cast from anon struct to unionLemonBoy
2020-03-22Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-21ir: Disallow comparison between enum literal and untagged enumLemonBoy
Closes #4770
2020-03-21ir: Allow errdefer with payloadLemonBoy
Closes #1265
2020-03-20ir: Peer type resolution between ?[]T and *[N]TLemonBoy
Closes #4767
2020-03-19Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-19fix compile error for reading past end of pointer casted arrayAndrew Kelley