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
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
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
if mproperty.mpropdefs.length <= 1 then return
# If all definitions of a method are live, we can remove the definition of the totry set
for d in mproperty.mpropdefs do
- if d.is_abstract then continue
if not live_methoddefs.has(d) then return
end
#print "full property: {mpropdef.mproperty} for {mpropdef.mproperty.mpropdefs.length} definitions"