X-Git-Url: http://nitlanguage.org diff --git a/src/rapid_type_analysis.nit b/src/rapid_type_analysis.nit index b4cf4ab..f5c1dc2 100644 --- a/src/rapid_type_analysis.nit +++ b/src/rapid_type_analysis.nit @@ -36,6 +36,13 @@ redef class ModelBuilder do var analysis = new RapidTypeAnalysis(self, mainmodule) analysis.run_analysis + + if toolcontext.opt_log.value then + var basename = toolcontext.log_directory / mainmodule.name + analysis.live_methods_to_tree.write_to_file(basename + ".rta_methods.txt") + analysis.live_types_to_csv.write_to_file(basename + ".rta_types.csv") + end + return analysis end end @@ -87,8 +94,7 @@ class RapidTypeAnalysis var anchor = callsite.anchor if anchor != null then mtype = mtype.anchor_to(callsite.mmodule, anchor) mtype = mtype.as_notnullable - assert mtype isa MClassType - mtype = mtype.mclass.intro.bound_mtype + if mtype isa MClassType then mtype = mtype.mclass.intro.bound_mtype var mproperty = callsite.mproperty var res = live_targets_cache[mtype, mproperty] if res != null then return res @@ -122,6 +128,7 @@ class RapidTypeAnalysis var types = typeset.to_a (new CachedAlphaComparator).sort(types) var res = new CsvDocument + res.format = new CsvFormat('"', ';', "\n") res.header = ["Type", "Resolution", "Liveness", "Cast-liveness"] for t in types do var reso