summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
797a26d)
Because type adaptation require recomputation on loops
Signed-off-by: Jean Privat <jean@pryen.org>
redef class FlowContext
# Store changes of types because of type evolution
private var vars = new HashMap[Variable, nullable MType]
redef class FlowContext
# Store changes of types because of type evolution
private var vars = new HashMap[Variable, nullable MType]
- private var cache = new HashMap[Variable, nullable Array[nullable MType]]
# Adapt the variable to a static type
# Warning1: do not modify vars directly.
# Adapt the variable to a static type
# Warning1: do not modify vars directly.
private fun set_var(variable: Variable, mtype: nullable MType)
do
self.vars[variable] = mtype
private fun set_var(variable: Variable, mtype: nullable MType)
do
self.vars[variable] = mtype
- self.cache.keys.remove(variable)
end
private fun collect_types(variable: Variable): nullable Array[nullable MType]
do
end
private fun collect_types(variable: Variable): nullable Array[nullable MType]
do
- if cache.has_key(variable) then
- return cache[variable]
- end
var res: nullable Array[nullable MType] = null
if vars.has_key(variable) then
var mtype = vars[variable]
var res: nullable Array[nullable MType] = null
if vars.has_key(variable) then
var mtype = vars[variable]