| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | c: factor out to tldecl(), improve error recovery, | 2025-12-20 | 1 | -73/+97 | |
| | | |||||
| * | c: support 0-length arrays as syntax for flexible array members | 2025-12-19 | 1 | -19/+29 | |
| | | | | | | Keeping the expr around in the decllist paves the way for VLA support later on | ||||
| * | c: fix incr/decr codegen for floats | 2025-12-19 | 1 | -2/+2 | |
| | | |||||
| * | c: hack to support __FUNCTION__ GNU extension | 2025-12-19 | 1 | -4/+10 | |
| | | |||||
| * | c: fix uninitiliazed field in decltypes | 2025-12-17 | 1 | -0/+1 | |
| | | |||||
| * | c: improve some type error diagnostics | 2025-12-15 | 1 | -13/+22 | |
| | | |||||
| * | create distinct interned string type | 2025-12-15 | 1 | -50/+51 | |
| | | | | | | | | | | | | | | | 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. | ||||
| * | lexer: use a hashmap to lookup keywords | 2025-12-15 | 1 | -1/+1 | |
| | | |||||
| * | c: error when defining function with incomplete parameter type | 2025-12-15 | 1 | -0/+4 | |
| | | |||||
| * | c: support forward-declared enums | 2025-12-15 | 1 | -34/+32 | |
| | | | | | This is a common non-standard GNU extension. | ||||
| * | c: emit data for __func__ lazily | 2025-12-15 | 1 | -15/+16 | |
| | | |||||
| * | c: fix another memory-leak-when-errors case | 2025-12-14 | 1 | -1/+2 | |
| | | |||||
| * | c: as a hack, warn for zero-length array instead of error | 2025-12-14 | 1 | -1/+1 | |
| | | | | | | Treated as unsized array T[]. This shows up in some linux headers as a non-standard way to have flexible array members. | ||||
| * | c: fix memory leak if initializer data if error | 2025-12-14 | 1 | -1/+1 | |
| | | |||||
| * | only put dats can in .text now when emitting it | 2025-12-14 | 1 | -2/+2 | |
| | | |||||
| * | various relocation related optimization | 2025-12-14 | 1 | -3/+3 | |
| | | | | | | | | | | | With 59ca5a8db, querying if a symbol is defined is cheap. If we're compiling code that calls foo() and we defined foo() in this compilation unit, we already know its offset within the .text section, so use it instead of emitting a relocation for the linker to handle. Also, put small literal data in the .text section instead of .rodata. This seems to improve performance (cache locality?), and as a bonus, it will be good for aarch64's instr encoding with smallish PC-relative offsets. | ||||
| * | c: handle more static eval edgecases for int -> ptr | 2025-12-13 | 1 | -1/+1 | |
| | | | | | | sqlite3 was falling back to `((void*)&((char*)0)[X])` for INT_TO_PTR, which this handles now. | ||||
| * | c: case/default labels only create new blocks when necessary | 2025-12-13 | 1 | -7/+11 | |
| | | |||||
| * | fix position independent loads of function symbols. | 2025-12-13 | 1 | -3/+3 | |
| | | | | | | | | | For `extern int x[1];`, can use PCREL32 for &x. But for `extern int x(int)`, must use GOTREL, when not being called directly (that's PLT). Therefore the type of an external symbol (actually just whether it denotes a function) matters when deciding what kind of relocation to emit, so keep that information. | ||||
| * | c: switch stmt diagnostics | 2025-12-12 | 1 | -8/+49 | |
| | | | | | For duplicate cases, case value overflow | ||||
| * | rename arraylength macro -> countof | 2025-12-11 | 1 | -23/+23 | |
| | | |||||
| * | c: accept C99 `[static N]` style array decls, changes to fn quals | 2025-12-11 | 1 | -24/+45 | |
| | | | | | | | Function parameters qualifiers don't matter outside of function definition. `int (const int)` should be compatible with `int(int)` etc. So no need to store them in the typedata. | ||||
| * | _Alignof and stuff | 2025-12-11 | 1 | -11/+18 | |
| | | |||||
| * | c: use a look-up table for isdecltok() | 2025-12-11 | 1 | -14/+18 | |
| | | |||||
| * | c: optimize environment decl lookup | 2025-12-11 | 1 | -6/+26 | |
| | | | | | | Use a hashmap for the toplevel, optimizing for the common use case where the file-scope has many more declarations than local scopes do | ||||
| * | c: disallow mismatched nested extern decl, & more diagnostics | 2025-12-11 | 1 | -17/+24 | |
| | | |||||
| * | c: support for noreturn, and decl parsing cleanup | 2025-12-11 | 1 | -107/+113 | |
| | | |||||
| * | c: expr2reloc() change sig to return addend | 2025-12-11 | 1 | -15/+12 | |
| | | |||||
| * | c: fix static relocation for &sym[offset] | 2025-12-10 | 1 | -7/+6 | |
| | | |||||
| * | c: fix compound assignment type conversions when types don't match | 2025-12-10 | 1 | -2/+3 | |
| | | |||||
| * | c: fix some static initialziers | 2025-12-08 | 1 | -1/+3 | |
| | | |||||
| * | c: fix more declaration parsing bugs | 2025-12-08 | 1 | -7/+17 | |
| | | |||||
| * | c: allow redeclaration with K&R and non K&R prototypes | 2025-12-03 | 1 | -2/+10 | |
| | | |||||
| * | c: make tentative definitions work | 2025-12-02 | 1 | -17/+34 | |
| | | |||||
| * | c: narrowing ints of different signedness... | 2025-12-01 | 1 | -1/+1 | |
| | | |||||
| * | c: edgecase for redeclaration of implicit sized array | 2025-12-01 | 1 | -1/+1 | |
| | | |||||
| * | c: fix some decl bugs and diagnostics | 2025-11-30 | 1 | -18/+34 | |
| | | |||||
| * | c/type: make implicit const T* -> T* conversion warning, not error | 2025-11-26 | 1 | -1/+8 | |
| | | |||||
| * | c: more static initializer fixes | 2025-11-26 | 1 | -7/+7 | |
| | | |||||
| * | c: fix elided-braces initializers for nested unions | 2025-11-26 | 1 | -5/+16 | |
| | | | | | | | | | For example in ```c struct {int a; union { int b,c; }; int d; } X = {1,2,3}; ``` Fields `a`,`b`,`d` must get initialized to 1,2,3. Not `c` | ||||
| * | c: fix condexprvalue | 2025-11-24 | 1 | -54/+42 | |
| | | | | | | The original implementation was broken when presented with nested short-circuiting logical operators. | ||||
| * | c: remove unused function | 2025-11-24 | 1 | -8/+0 | |
| | | |||||
| * | c: create dummy unreachable block after trap | 2025-11-24 | 1 | -5/+1 | |
| | | | | | | | Reverts 9abe27f6712. This simplies expr codegen, otherwise would manually have to check `fn->curblk != NULL` repeatedly. Later passes will easily delete those unreachable blocks | ||||
| * | ir: implement cvtu64f. and other bug fixes | 2025-11-23 | 1 | -1/+4 | |
| | | | | | | compiler is bootstrapping?! however, stage1 and stage2+ executables aren't bit-identical.. small differences in the codegen.. need to look into that | ||||
| * | c: check actual reachability for non-void func may not return value | 2025-11-23 | 1 | -2/+6 | |
| | | |||||
| * | c: implement compound initializer in static context | 2025-11-23 | 1 | -2/+18 | |
| | | |||||
| * | c: fix runtime implicit-length array initializer | 2025-11-23 | 1 | -2/+3 | |
| | | |||||
| * | implement float varargs, and some other fixes | 2025-11-23 | 1 | -0/+3 | |
| | | |||||
| * | c: fix precedence of conditional expression rhs | 2025-11-22 | 1 | -2/+2 | |
| | | |||||
| * | c: make the warning for '()' function declarations less strict | 2025-11-22 | 1 | -1/+1 | |
| | | |||||