aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted
AgeCommit message (Collapse)Author
2020-08-18stage2/wasm: only free types after func overwriteIsaac Freund
Functions which are free'd are not immediately removed from the binary as this would cause a shifting of function indexes. Instead, they hang around until they can be overwritten by a new function. This means that the types associated with these dead functions must also remain until the function is overwritten to avoid a type mismatch.
2020-08-18stage2/wasm: write exports on flush, cleanupIsaac Freund
Exports now have a dirty flag and are rewritten on flush if this flag has been set. A couple other minor changes have been made based on Andrew's review.
2020-08-18stage2/wasm: implement trivial codegenIsaac Freund
We now generate code for returning constants of any of the basic types.
2020-08-18stage2/wasm: implement basic container generationIsaac Freund
Thus far, we only generate the type, function, export, and code sections. These are sufficient to generate and export simple functions. Codegen is currently hardcoded to `i32.const 42`, the main goal of this commit is to create infrastructure for the container format which will work with incremental compilation.
2020-08-18Merge pull request #6060 from Vexu/stage2Veikka Tuominen
Stage2: more optionals stuff
2020-08-17Merge pull request #6046 from heidezomp/std-log-scoped-part2Andrew Kelley
std.log: (breaking) remove scope parameter from logging functions
2020-08-17address review feedbackVexu
2020-08-17Move Mach-O to link/MachO.zig submoduleJakub Konka
Remove `ptrWidth` since as of Catalina, all apps are 64bits only. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-17Add skeleton for MachO support in stage2Jakub Konka
This commit adds an empty skeleton for MachO format support in stage2.
2020-08-17stage2: astgen for if and while with error unionsVexu
2020-08-17stage2: astgen for if and while with optionalsVexu
2020-08-17stage2: fix optimization causing wrong optional child typesVexu
2020-08-17stage2: astgen for ptr types and address ofVexu
2020-08-17Merge pull request #6048 from pixelherodev/cleanupAndrew Kelley
Some minor cleanup and error handling
2020-08-17stage2: fix signed <-> unsigned Value castsIsaac Freund
2020-08-16Astgen: further cleanupNoam Preil
2020-08-16Module: panic when encountering unimplemented nodeNoam Preil
2020-08-16CBE: minor doc changeNoam Preil
2020-08-16astgen: minor cleanupNoam Preil
2020-08-15stage2: implement zig versionAndrew Kelley
2020-08-15stage2: codegen for labeled blocksAndrew Kelley
2020-08-15stage2: astgen for labeled blocks and labeled breaksAndrew Kelley
2020-08-14stage2: populate some of the astgen switch possibilitiesAndrew Kelley
Idea here is simply to entice people to contribute astgen code :)
2020-08-14stage2 astgen for LabeledBlockAndrew Kelley
2020-08-14std.zig.ast: extract out Node.LabeledBlock from Node.BlockAndrew Kelley
This is part of an ongoing effort to reduce size of in-memory AST. This enum flattening pattern is widespread throughout the self-hosted compiler. This is a API breaking change for consumers of the self-hosted parser.
2020-08-14stage2: proper semantic analysis of improper returning of implicit voidAndrew Kelley
2020-08-14stage2: astgen for non-labeled blocksAndrew Kelley
2020-08-13stage2: implement while loops (bool condition)Andrew Kelley
* introduce a dump() function on Module.Fn which helpfully prints to stderr the ZIR representation of a function (can be called before attempting to codegen it). This is a debugging tool. * implement x86 codegen for loops * liveness: fix analysis of conditional branches. The logic was buggy in a couple ways: - it never actually saved the results into the IR instruction (fixed now) - it incorrectly labeled operands as dying when their true death was after the conditional branch ended (fixed now) * zir rendering is enhanced to show liveness analysis results. this helps when debugging liveness analysis. * fix bug in zir rendering not numbering instructions correctly closes #6021
2020-08-13stage2: zir_sema for loopsAndrew Kelley
Also remove the "repeat" instruction and make it implied to be at the end of a Loop body.
2020-08-14Merge pull request #6045 from Vexu/blockVeikka Tuominen
Add error for unused/duplicate labels.
2020-08-13stage2: implement safety checks at the zir_sema levelAndrew Kelley
2020-08-13translate-c: add return if one is neededVexu
2020-08-13update std and src-self-hosted for std.log breaking changeheidezomp
2020-08-13stage2: split unwrap_optional to safe and unsafe verionsVexu
2020-08-13stage2: implement unwrap optionalVexu
2020-08-13stage2: gen optional typesVexu
2020-08-13stage2: add optional typesVexu
2020-08-13translate-c: ensure generated labels are uniqueVexu
2020-08-12stage2: anyerror -> explicit error setAndrew Kelley
2020-08-12CBE: renderValue pays attention to Type, not TagNoam Preil
2020-08-12CBE: fix handling of IR dependenciesNoam Preil
2020-08-12CBE: Sorta working intcasts?Noam Preil
2020-08-12CBE: support unreachable on GCCNoam Preil
2020-08-12CBE: working parametersNoam Preil
2020-08-12Tests: print generated C on test failureNoam Preil
2020-08-12CBE: Use zig_noreturn instead of noreturn to avoid namespace conflictNoam Preil
2020-08-12CBE: improve noreturn definition, support noreturn on MSVCNoam Preil
2020-08-12stage2: astgen for while loopsAndrew Kelley
See #6021
2020-08-13add error for unused/duplicate block labelsVexu
2020-08-11stage2: basic support for parameters .debug_infoAndrew Kelley
see #6014