X-Git-Url: http://nitlanguage.org diff --git a/src/rapid_type_analysis.nit b/src/rapid_type_analysis.nit index a87a48f..2d621e8 100644 --- a/src/rapid_type_analysis.nit +++ b/src/rapid_type_analysis.nit @@ -25,7 +25,7 @@ module rapid_type_analysis import semantize -private import csv # for live_types_to_csv +import csv # for live_types_to_csv private import ordered_tree # for live_methods_to_tree private import more_collections @@ -132,7 +132,7 @@ class RapidTypeAnalysis var types = typeset.to_a (new CachedAlphaComparator).sort(types) var res = new CsvDocument - res.format = new CsvFormat('"', ';', "\n") + res.separator = ';' res.header = ["Type", "Resolution", "Liveness", "Cast-liveness"] for t in types do var reso @@ -258,11 +258,13 @@ class RapidTypeAnalysis var npropdef = modelbuilder.mpropdef2node(mmethoddef) if npropdef isa AClassdef then - # It is an init for a class - assert mmethoddef == npropdef.mfree_init - - if mmethoddef.mproperty.is_root_init and not mmethoddef.is_intro then - self.add_super_send(v.receiver, mmethoddef) + if mmethoddef.mproperty.is_root_init then + if not mmethoddef.is_intro then + self.add_super_send(v.receiver, mmethoddef) + end + else + npropdef.debug "cannot RTA {mmethoddef}" + abort end continue else if mmethoddef.constant_value != null then @@ -312,7 +314,9 @@ class RapidTypeAnalysis if not check_depth(rt) then continue #print "{ot}/{t} -> {rt}" live_types.add(rt) - todo_types.add(rt) + # unshift means a deep-first visit. + # So that the `check_depth` limit is reached sooner. + todo_types.unshift(rt) end end #print "MType {live_types.length}: {live_types.join(", ")}" @@ -583,6 +587,11 @@ redef class AStringFormExpr v.add_type(native) var prop = v.get_method(native, "to_s_full") v.add_monomorphic_send(native, prop) + v.add_callsite(to_re) + v.add_callsite(ignore_case) + v.add_callsite(newline) + v.add_callsite(extended) + v.add_callsite(to_bytes_with_copy) end end