HoneyPony / jaylox

A compiler/transpiler targetting C, for the Lox language from Crafting Interpreters
0 stars 0 forks source link

Optimization: Any globals only accessed in main should be turned in to locals #5

Closed HoneyPony closed 1 week ago

HoneyPony commented 1 week ago

This would allow for any optimizations to locals, such as type-flow analysis / fence-elision / whatever, to be automatically applied to any variables that are only accessed in main, without any otherwise special logic.

HoneyPony commented 1 week ago

Hmm, this is partially implemented by f7d9e8b, but apparently now globals are not being used at ALL by main(), which is incorrect.