aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* eval & fold: handle division overflow for MIN/-1lemon2026-03-142-2/+9
|
* cpp: better handling for #include file not foundlemon2026-03-141-12/+20
| | | | | | Instead of attempting to keep going (since things will probably break due to missing declarations), just report any other #include errors and abort.
* make clean rm --lemon2026-03-141-1/+1
|
* c: static eval refactoringlemon2026-03-148-279/+426
| | | | | Explicit node for static symbol (addresses). Should not break with edge cases like the previous ad-hoc approach. And some other bugfixes
* x86_64/isel: fix edge case with branch on float add resultlemon2026-03-112-1/+6
| | | | | | | | In `if (x + 1)` the implicit `!= 0` can be omitted for integers, because the x86 `add` instruction sets the zero flag accordingly. But for floats it doesn't, so applying that optimization there was wrong. Luckily it was caught by a nullptr dereference later in `emit::Xjcc()` for the (missing) unordered branch target, instead of miscompiling.
* c: relax constexpr constraints, fix alignoflemon2026-03-093-30/+62
| | | | | | | | | | | | - Allow short-circuiting of constant logical expressions where the unevaluated operand is not a constant expression (`1 || 0/0`) - Allow constant integer expressions that evaluate to zero to be used as null pointer constants (GNU extension). + According to the standard, `int *x = 5*0;` should be rejected. But compilers evaluate `5*0 -> 0` and allow it as if a null pointer literal.
* 0.1.10lemon2026-03-081-2/+2
|
* fix some more cases of signed integer overflowlemon2026-03-082-3/+3
|
* x86_64/emit: fix float store zero, unsafe range check for mul immediatelemon2026-03-081-1/+5
|
* ir/fold: fix float conversion overflowslemon2026-03-081-4/+14
|
* ir: fix inlining getting stuck on complex recursive call sequenceslemon2026-03-082-8/+30
| | | | | By maintaining a proper stack of inline expansions and refusing to expand callers already present in the stack.
* x86_64/isel: cleanup and fix edge caseslemon2026-03-082-79/+76
|
* ir: increase per-function stack size limitlemon2026-03-061-1/+1
|
* cpp: #include MACRO, free tkslemon2026-03-061-0/+1
|
* c: recognize another static initializer edge caselemon2026-03-051-3/+2
| | | | | | I think globsym & expr2reloc should be rewritten to be more robust to this kind of thing. Accumulate offsets whilst recursing into the child node that might contain a direct global symbol reference kind of thing.
* cpp: get rid of unnecessary ugly global variable for lexing header namelemon2026-03-051-31/+23
| | | | Make it a parameter.
* cpp: implement #include MACRO_NAMElemon2026-03-051-55/+98
|
* cpp: #include".." shouldn't look in working directorylemon2026-03-051-6/+8
|
* c: do not try to eval conditional expression's not taken branchlemon2026-03-052-2/+2
|
* ccopt.dbg.any -> uintlemon2026-03-041-1/+1
| | | | So it encompasses every bitfield.
* ir/dump: fix dumping data in .textlemon2026-03-041-4/+16
|
* regalloc: fix minor regression with storing of regs into spilled stack slotslemon2026-03-041-1/+1
|
* driver: fix -pthread, -Ulemon2026-03-022-2/+6
|
* add bswap16/32/64lemon2026-03-0210-37/+125
| | | | | - frontend: __builtin_bswapX intrinsics - backend: ObswapX instructions
* cpp: fix token spacing edge case when empty macros are involvedlemon2026-03-012-3/+8
|
* cpp: fix token spacing (#2) (hopefully)lemon2026-03-013-35/+104
|
* 0.1.9lemon2026-02-281-2/+2
|
* ir: make address ref hash table resizablelemon2026-02-287-27/+49
| | | | Would hit the limit on very large functions (thanks csmith).
* Update README.mdlsof2026-02-281-1/+1
|
* c: static intializer bugfix introduced in6c3f1593e9lemon2026-02-281-0/+1
|
* aarch64/isel: handle more instructionslemon2026-02-281-13/+18
|
* backend: fix edgecases where imm32 immediate overflowslemon2026-02-282-3/+10
|
* regalloc: fix defn of spilled var with immediatelemon2026-02-282-2/+16
| | | | | | With `i64 %a = copy 0xabcdef12345`, if `%a` was spilled, this would turn into a `storei64` instruction with an unencondable immediate operand (larger than 32 bits in x86, non-zero in aarch64).
* cpp: allow comments between function-like macro name and argumentslemon2026-02-262-9/+29
|
* 0.1.8lemon2026-02-251-2/+2
|
* c: allow casting of symbol address to intptr_t in static initializerslemon2026-02-252-2/+4
|
* preprocessor: use shared static buffers for replacement listslemon2026-02-251-150/+178
| | | | | | | One for macro definitions' bodies, another one for function-like macros with substituted arguments in the macro expansion stack. Cuts down on a lot of individual allocations. #undef'd macros' replacement lists are "leaked" but that is very minor
* fix io fa8c39d6df : make buffer shared (for nested note())lemon2026-02-241-1/+1
|
* fix various warningslemon2026-02-246-14/+11
|
* inline: fix undefined value returnslemon2026-02-241-1/+2
| | | | | | Previously if an inlined function has a return statement with no value (control flow reaching the closing brace of the function), would use an invalid null reference in the inlined body. Turn it into undef.
* io: use distinct output buffer for diagnosticslemon2026-02-241-14/+24
| | | | | Prevents concurrent invokations of the compiler from mixing up and mangling diagnostics from unbuffered stderr.
* diagnostics: also print #include provenance for warningslemon2026-02-243-4/+10
|
* C23 true and false keywordslemon2026-02-243-4/+9
|
* update license copyright yearlemon2026-02-241-1/+1
|
* Update README.mdlemon2026-02-241-0/+1
|
* x86_64/isel: fix regression with cmp instrs edge caselemon2026-02-241-1/+1
|
* cpp: fix __has_builtinlemon2026-02-231-2/+8
|
* add metalang99 testsuite (preprocessor stress testing)lemon2026-02-23119-2/+16971
|
* cpp: add __COUNTER__ macrolemon2026-02-233-131/+196
|
* 0.1.7lemon2026-02-222-3/+3
|