There is one GlobalCompilerVisitor per C function, therefore having
the cache here was stupid.
GlobalCompiler is a singleton and is better suited to manage the cache.
Signed-off-by: Jean Privat <jean@pryen.org>
self.extern_bodies.add(tryfile)
end
end
+
+ private var collect_types_cache: HashMap[MType, Array[MClassType]] = new HashMap[MType, Array[MClassType]]
end
redef class String
var types = [mtype]
return types
end
- var cache = self.collect_types_cache
+ var cache = self.compiler.collect_types_cache
if cache.has_key(mtype) then
return cache[mtype]
end
return types
end
- private var collect_types_cache: HashMap[MType, Array[MClassType]] = new HashMap[MType, Array[MClassType]]
-
fun resolve_for(mtype: MType, recv: RuntimeVariable): MType
do
if not mtype.need_anchor then return mtype