aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
AgeCommit message (Collapse)Author
2019-12-02bring your own OS layer in the std libAndrew Kelley
closes #3784
2019-12-02fix crash assigning optional struct with anon literalAndrew Kelley
closes #3827
2019-12-01fix invalid check for fn_inline propertyAndrew Kelley
2019-12-01fix docs regressionsAndrew Kelley
2019-12-01fix regressions in compile error testsAndrew Kelley
2019-12-01fix assigning to an unwrapped optional field in an inline loopAndrew Kelley
2019-12-01add advanced IR debugging supportAndrew Kelley
and use it to improve copy_const_val with regards to parent backrefs
2019-12-01Merge remote-tracking branch 'origin/kill-ConstGlobalRefs' into ↵Andrew Kelley
remove-array-type-coercion
2019-12-01Merge remote-tracking branch 'origin/master' into remove-array-type-coercionAndrew Kelley
2019-12-01sometimes free stuff from Zig IR pass 1Andrew Kelley
Total bytes used in stage1 std lib tests: 3.418 -> 3.198 GiB (saving 225 MiB) There's still this from pass 1 not getting freed: Const: 6909049 items, 72 bytes each, total 474.407 MiB This is due to 2 things hanging on to references to IrAnalyze pointers: * ZigVar->owner_exec->analysis * LazyValue->ira The LazyValue one could be solved by memoizing the results after the lazy value is resolved, and then it could unref the IrAnalyze. ZigVars that are determined to be comptime const, could have their const_value set to that value, instead of using the mem_slot_index mechanism. This would prevent an IrAnalyze ref in some cases.
2019-12-01inline ConstGlobalRefs into ZigValueAndrew Kelley
Having ConstGlobalRefs be a pointer in ZigValue was a hack that caused plenty of bugs. It was used to work around difficulties in type coercing array values into slices. However, after #3787 is merged, array values no longer type coerce into slices, and so this provided an opportunity to clean up the code. This has the nice effect of reducing stage1 peak RAM usage during the std lib tests from 3.443 GiB to 3.405 GiB (saving 39 MiB). There is one behavior test failing in this branch, which I plan to debug after merging #3787.
2019-11-30free IrAnalyze sometimesAndrew Kelley
Total bytes used in stage1 std lib tests: 3.443 GiB -> 3.418 GiB
2019-11-29fix typo in error note for integer castingAndrew Kelley
2019-11-29fix empty result location for parameters not workingAndrew Kelley
2019-11-29fix `@bitCast` result coercing to error union by returningAndrew Kelley
2019-11-29fix return result loc as peer result loc in inferred error set functionAndrew Kelley
2019-11-28more progressAndrew Kelley
2019-11-27remove type coercion from array values to referencesAndrew Kelley
* Implements #3768. This is a sweeping breaking change that requires many (trivial) edits to Zig source code. Array values no longer coerced to slices; however one may use `&` to obtain a reference to an array value, which may then be coerced to a slice. * Adds `IrInstruction::dump`, for debugging purposes. It's useful to call to inspect the instruction when debugging Zig IR. * Fixes bugs with result location semantics. See the new behavior test cases, and compile error test cases. * Fixes bugs with `@typeInfo` not properly resolving const values. * Behavior tests are passing but std lib tests are not yet. There is more work to do before merging this branch.
2019-11-26add compiler note for bad int coercionAndrew Kelley
closes #3724
2019-11-26add missing cast to generic function call resultVexu
2019-11-26add missing cast to call result typeVexu
2019-11-25stage1: fix bad intern countingMichael Dusan
2019-11-25Merge pull request #3774 from mikdusan/stage1-intern-housekeepingMichael Dusan
stage1: consolodate interning
2019-11-25move logic to the appropriate layers; add new compile errorAndrew Kelley
2019-11-25stage1: consolodate interningMichael Dusan
- merge const_void_val → intern.x_void - move const_zero_byte → intern.zero_byte - wrap intern access
2019-11-25const interning for 1-possible-value typesMichael Dusan
2019-11-25unembed ZigValue from IrInstructionMichael Dusan
2019-11-25rename ConstExprValue → ZigValueMichael Dusan
2019-11-24Merge remote-tracking branch 'origin/master' into null-terminated-pointersAndrew Kelley
2019-11-24fix compile errors for array sentinels mismatchingAndrew Kelley
2019-11-24fix casting `[N:x]T` to `[N]T` memcpying too many bytesAndrew Kelley
2019-11-24fix compile error regressionsAndrew Kelley
2019-11-24add compile error for incompatible pointer sentinelsAndrew Kelley
2019-11-24fix comptime `@ptrCast` of pointers to arraysAndrew Kelley
2019-11-24add type coercion: [:x]T to [*:x]TAndrew Kelley
2019-11-24all tests passingAndrew Kelley
2019-11-23structs can have fields with type `var`Andrew Kelley
behavior tests passing now
2019-11-23update the stage1 implementation to the new proposalAndrew Kelley
See #3731
2019-11-21fix missing implicit cast in return instructionVexu
2019-11-21update tests, better error messages, update self-hosted tokenizerAndrew Kelley
2019-11-21better error message when null termination does not matchAndrew Kelley
2019-11-21string literals are now null terminatedAndrew Kelley
this also deletes C string literals from the language, and then makes the std lib changes and compiler changes necessary to get the behavior tests and std lib tests passing again.
2019-11-21add null terminated pointers and arrays to self-hostedAndrew Kelley
as well as `@typeInfo` and `@Type`
2019-11-21implement null terminated pointersAndrew Kelley
2019-11-17fix bug on empty error uniondaurnimator
2019-11-17Catch invalid type from peer resolutionLemonBoy
Fixes #3703
2019-11-14rework layout of struct type fieldsAndrew Kelley
This removes the remaining hack in the implementation of anonymous struct literals, and they can now therefore now have greater than 16 fields/elements.
2019-11-14rework comptime struct value layout, removing 1/2 hacksAndrew Kelley
in the implementation of anonymous struct literals
2019-11-13add compile error for @atomicRmw on enum not being an .XchgVexu
2019-11-13Merge pull request #3675 from Vexu/atomic-storeAndrew Kelley
Add @atomicStore builtin