mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
Rewrite init() interpretation to a real interpreter
Instead of mostly heuristics, actually execute the init() instruction in an interpreter to calculate initializers for globals. This is far more flexible and extensible, and gives the option of extending the interpreter to other code and make it a partial evaluator.
This commit is contained in:
@@ -38,9 +38,10 @@ type Function struct {
|
||||
|
||||
// Global variable, possibly constant.
|
||||
type Global struct {
|
||||
g *ssa.Global
|
||||
llvmGlobal llvm.Value
|
||||
flag bool // used by dead code elimination
|
||||
g *ssa.Global
|
||||
llvmGlobal llvm.Value
|
||||
flag bool // used by dead code elimination
|
||||
initializer Value
|
||||
}
|
||||
|
||||
// Type with a name and possibly methods.
|
||||
|
||||
Reference in New Issue
Block a user