aboutsummaryrefslogtreecommitdiffhomepage
path: root/mem.c
Commit message (Collapse)AuthorAgeFilesLines
* optimize lexer a bit morelemon2025-12-201-5/+10
|
* create distinct interned string typelemon2025-12-151-3/+3
| | | | | | | | | | | | | | Interned strings are used pervasively, so it's a good idea to add a layer of type safety to differentiate them from general cstrs and avoid potential bugs from comparing non-interned and interned strings. Not that that's happened so far that I can remember, but it could. I'm 90% sure it's legal to alias `struct {char c;}` pointers with `char` pointers. This specific typedef gives type safety but with a simple one-way `internstr -> const char *` typecast (with `&istr->c`). Converting the other way around is more intentional: a straight up cast `(internstr)cstr` which sticks out as unchecked and probably wrong, or calling the intern(cstr) function, which is the right way.
* move intern() to mem.clemon2025-12-151-1/+49
| | | | | Being in lex.c was vestigial, since it was being used all over the frontend and backend.
* lexer: use a hashmap to lookup keywordslemon2025-12-151-0/+1
|
* lex: use pmap for macro lookuplemon2025-12-121-6/+25
| | | | To reduce hashmap code repetition. Also add pmap_del for this purpose
* mem: fix pmap_init and change hashmap load factors to 75%lemon2025-12-091-4/+3
|
* lex: remove some hacks and optimize preprocessorlemon2025-11-281-1/+1
|
* refactor vec_of(T) and misclemon2025-10-201-38/+45
|
* bugfix for initzlemon2025-10-081-1/+2
|
* alloc changeslemon2025-09-171-1/+9
|
* change freearena for correctnesslemon2025-09-141-6/+7
|
* regalloc improvementslemon2025-09-141-0/+6
|
* regalloc: start implementing linear scanlemon2025-09-081-10/+3
|
* add initializers (only static for initialier list rn)lemon2023-06-291-2/+13
| | | | and other fixes
* fix memory bugslemon2023-06-181-5/+7
|
* basic ELF outputlemon2023-06-171-5/+5
|
* lower allocas in isel() instead of emit() and misc fixeslemon2023-06-131-12/+12
|
* bugfixlemon2023-06-121-1/+1
|
* register renaming and suchlemon2023-06-121-38/+103
|
* evaluate call args backwardslemon2023-06-041-0/+8
|
* regalloc skeletonlemon2023-05-311-0/+4
|
* hmlemon2023-05-261-0/+93
|
* initial commitlemon2023-05-101-0/+117