aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* mem2reg rewritelemon2026-03-242-108/+74
| | | | | | | Do it in 2 passes: 1. gather variables, 2. step thru RPO transforming loads/stores to each variable. More elegant solution to f9e3a52eaa. More efficient since all variable usages are visited in CFG order, which matters due to block sealing.
* 0.2.3lemon2026-03-231-2/+2
|
* IR: emit inline function standalone bodies lazilylemon2026-03-2310-41/+139
| | | | | | | If a function is stashed for inlining and inlined in all of its callsites or unused, it never ends up in the object file. If any symbol reference to it is emitted, then it must be de-inlined (rematerialized), and this is done near the end before emitting the actual object file.
* IR: mark free'd instructions as suchlemon2026-03-238-44/+54
| | | | | That way they are not copied when inlining. Also rename ninstr -> ninstrtab. opnarg -> opnoper
* 4f2fb9ba5f fixlemon2026-03-231-1/+2
|
* <iso646.h>, test for libc headerslemon2026-03-233-4/+62
|
* tests: don't rely on unportable %p outputlemon2026-03-232-7/+11
|
* rega/devirt: don't assume unused operands are zeroinitializedlemon2026-03-231-1/+1
|
* c: recognize __alignof__ and __alignas__lemon2026-03-231-2/+2
|
* c: __attribute__ after declaratorlemon2026-03-231-0/+1
|
* io: use FILE* for buf fp impllemon2026-03-232-8/+10
|
* c: __attribute__ in more placeslemon2026-03-231-0/+2
|
* c: remove inline 'backing' type tag for enumslemon2026-03-233-9/+4
| | | | | | | | | | It was meant as a micro-optimization but actually keeping it in sync was annoying. This for example was broken: ``` extern enum foo { ... } g_foo; enum foo g_foo; ```
* style: change uvlong -> u64int, vlong -> s64intlemon2026-03-2222-125/+125
| | | | | Is much nicer. I don't know whether I want to do it for the other int types too. char and uchar are fine as bytes. u/short -> u/s16int, maybe.
* Update README.mdlsof2026-03-221-0/+1
| | | | OpenBSD working & tested
* aarch64: rem/urem, bswap*, arg bugfixlemon2026-03-225-12/+67
|
* eval: fix errata in EGETF addr caselemon2026-03-221-1/+1
| | | | | | | The symref given by staticaddrof is in ex2, not sub. This worked by chance (with sub->ssym.off happening to be zero) on linux, but on OpenBSD it would give garbage. Which would result in messed up relocations later leading to miscompilations.
* mem2reg: improve on f9e3a52eaalemon2026-03-221-2/+18
| | | | | Move the alloca to the beginning of the block and do a 2nd pass on those odd cases.
* mem2reg: fix rare edge case with weird control flowlemon2026-03-222-0/+30
| | | | | | | | | mem2reg was assuming alloca's appeared before all their uses. When this didn't happen it broke the logic re. sealed blocks. Normally this doesn't happen in most natural code. Even with gotos, RPO would assure this in most cases, the exception I found is a goto that jumps into a loop past a variable declaration that is earlier in the loop. Then even RPO would keep the alloca itself past the first uses, breaking things.
* IR: add 3rd operand to Instrlemon2026-03-2219-167/+171
| | | | | The motivation is for aarch64 msub/madd instrs, for isel to produce. But it should be useful for other things too.
* test/lua -> change Makefile to PLAT=posixlemon2026-03-212-2/+2
|
* Rework handling of predefined macros.lemon2026-03-2111-95/+228
| | | | And add some GCC predefs like __SIZE_TYPE__, __LONG_SIZE__, etc
* 0.2.2lemon2026-03-211-2/+2
|
* oops.lemon2026-03-211-1/+1
|
* OSunk -> unknownlemon2026-03-211-2/+2
|
* Tweak configure & driver, fallback to cclemon2026-03-212-15/+29
|
* configure shellcheck, againlemon2026-03-211-5/+5
|
* configure: sh shell conformancelemon2026-03-211-1/+1
|
* fix again for openbsdlemon2026-03-202-4/+4
|
* c: fix crash with dead code in condexprlemon2026-03-201-1/+2
|
* driver: only depend on ld for linking (todo)lemon2026-03-205-47/+155
|
* c: better preserve source location in some caseslemon2026-03-202-2/+8
|
* io: make -w suppress notes toolemon2026-03-205-16/+17
|
* c: fix isboollike() for phislemon2026-03-191-2/+3
|
* 0.2.1lemon2026-03-191-2/+2
|
* c: fix qualifiers for array declaratorslemon2026-03-192-7/+16
| | | | | | `const int x[]` was being treated as `const int x[const]`, which is wrong, and matters when `x` is a function parameter that really decays to a pointer (`int const *const x`)
* Shell script changes for portabilitylemon2026-03-193-13/+18
|
* test: add test for __func__lemon2026-03-191-0/+2
|
* ir: do not always try to put small literals in .textlemon2026-03-192-4/+13
| | | | | OpenBSD enforces read xor execute (XOM) even in x86-64. Not aware of any other platforms that do this.
* preeliminary support for openBSDlemon2026-03-195-16/+46
|
* regalloc & emit: explicit comparisons over memcmp of small structureslemon2026-03-192-3/+19
| | | | | The one in x86-64_emit was not portable due to relying on zero initialization of inactive union fields/padding.
* cpp: fix nullptr deref for unknown target predefslemon2026-03-191-1/+1
|
* c: remove unused initialization of decl.alignlemon2026-03-191-3/+3
| | | | | The intent is for _Alignas declarations but those aren't implemented yet. And initializing that field in declarator() can mess with .sym.
* c: fix edge cases with zero sized bitfields and static initializerslemon2026-03-183-10/+31
|
* regalloc: use in-place mergesort for intervalslemon2026-03-181-60/+60
| | | | | | Instead of constructing an array and doing quicksort. i love .02% speedup microoptimizations
* cpp: do not warn for "#define X(){}" with no space after the )lemon2026-03-181-1/+1
|
* 0.2.0lemon2026-03-181-3/+3
| | | | Changed directory/source files structure warrants minor version update.
* Use #pragma oncelemon2026-03-188-17/+12
|
* c.h: accidentally removed a constlemon2026-03-181-1/+1
|
* README missed filenamelemon2026-03-181-1/+1
|