aboutsummaryrefslogtreecommitdiff
path: root/BRANCH_TODO
blob: 3c6ebdb7698fe750c52f15da49b5e0c6fe604364 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
this is my WIP branch scratch pad, to be deleted before merging into master

Merge TODO list:
 * uncomment the commented out stage2 tests
 * remove the LazySrcLoc.todo tag
 * update astgen.zig
 * finish updating Sema.zig
 * finish implementing SrcLoc byteOffset function
 * audit all the .unneeded src locations
 * audit the calls in codegen toSrcLocWithDecl specifically if there is inlined function
   calls from other files.

Performance optimizations to look into:
 * astgen: pass *GenZir as the first arg, not *Module
   - point here is to avoid the unnecessary virtual call scope.getGenZir()
 * don't store end index for blocks; rely on last instruction being noreturn
 * look into not storing the field name of field access as a string in zir
   instructions. or, look into introducing interning to string_bytes (local
   to the owner Decl), or, look into allowing field access based on a token/node
   and have it reference source code bytes. Another idea: null terminated
   string variants which avoid having to store the length.
   - Look into this for enum literals too
 * make ret_type and ret_ptr instructions be implied indexes; no need to have
   tags associated with them.
 * use a smaller encoding for the auto generated return void at the end of
   function ZIR.
 * enum literals can use small strings
 * string literals can use small strings
 * don't need the Sema coercion on condbr condition, it's done with result locations
 * astgen for loops using pointer arithmetic because it's faster and if the programmer
   wants an index capture, that will just be a convenience variable that zig sets up
   independently.
 * in astgen, if a decl_val would be to a const variable or to a function, there could be
   a special zir.Inst.Ref form that means to refer to a decl as the operand. This
   would elide all the decl_val instructions in the ZIR.
 * don't have an explicit dbg_stmt zir instruction - instead merge it with
   var decl and assignment instructions, etc.
   - make it set sema.src where appropriate
 * look into not emitting redundant dbg stmts to TZIR