interp: refactor to eliminate lots of code

This may cause a small performance penalty, but the code is easier to
maange as a result.
This commit is contained in:
Ayke van Laethem
2019-03-06 14:22:26 +01:00
committed by Ron Evans
parent cfc1a66e8d
commit b7cdf8cd0c
3 changed files with 89 additions and 330 deletions
+1 -5
View File
@@ -124,11 +124,7 @@ func (e *Eval) function(fn llvm.Value, params []Value, pkgName, indent string) (
// getValue determines what kind of LLVM value it gets and returns the
// appropriate Value type.
func (e *Eval) getValue(v llvm.Value) Value {
if !v.IsAGlobalVariable().IsNil() {
return &GlobalValue{e, v}
} else {
return &LocalValue{e, v}
}
return &LocalValue{e, v}
}
// markDirty marks the passed-in LLVM value dirty, recursively. For example,