Commit Graph

18 Commits

Author SHA1 Message Date
Andrew Kelley d18b6785bb stage2: C backend improvements
* Module: improve doc comments
 * C backend: improve const-correctness
 * C backend: introduce renderTypeAndName
 * C backend: put `static` on functions when appropriate
 * C backend: fix not handling errors in genBinOp
 * C backend: handle more IR instructions
   - alloc, store, boolean comparisons, ret_ptr
 * C backend: call instruction properly stores its result
 * test harness: ensure execution tests have empty stderr
2020-12-29 17:56:30 -07:00
Andrew Kelley 813d3308cc stage2: update C backend test cases for new output 2020-12-28 20:32:13 -07:00
Andrew Kelley bbe66572e1 stage2: C backend: handle string literals more gracefully 2020-12-28 20:15:17 -07:00
Andrew Kelley a54ccd8537 stage2: C backend: implement @breakpoint and clean up test harness 2020-12-28 18:43:01 -07:00
Andrew Kelley 37f04d66be stage2: C backend: properly render type of array decls 2020-12-28 18:24:55 -07:00
Andrew Kelley 52056b156b stage2: C backend: pointer cast decl refs if necessary 2020-12-28 17:46:50 -07:00
Andrew Kelley 87c6341b61 stage2: add extern functions
and improve the C backend enough to support Hello World (almost)
2020-12-28 17:15:29 -07:00
Andrew Kelley f75d4cbe56 Revert "stage2: add compile log statement (#7191)"
The addition of `addDeclErr` introduced a memory leak at every call
site, and I also would like to push back on having more than 1
compilation error per `Decl`.

This reverts commit 1634d45f1d.
2020-12-28 11:24:53 -07:00
g-w1 1634d45f1d stage2: add compile log statement (#7191) 2020-12-26 02:40:49 +02:00
Noam Preil 37438dd789 CBE: add support for bool,u32 2020-12-23 01:14:35 +11:00
Alex Cameron 40f0275e7c Implement emit-h 2020-12-23 01:14:35 +11:00
Vexu 28a0583b84 run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
Noam Preil 7b88215a49 Replace error message with unreachable 2020-10-06 15:09:57 -04:00
Noam Preil ea7b2750c8 CBE: addition and subtraction 2020-10-06 15:09:57 -04:00
Noam Preil e06ba9e86e CBE: properly resolve Insts 2020-10-06 15:09:57 -04:00
Noam Preil 9ef6c0a035 CBE: utilize per-function arena allocator 2020-10-06 15:09:56 -04:00
Noam Preil ce29fc0947 Make indentation adjustable (hardcode 4 spaces for now) 2020-10-06 15:09:56 -04:00
Andrew Kelley 528832bd3a rename src-self-hosted/ to src/ 2020-09-21 18:38:55 -07:00