+ var poset = mainmodule.flatten_mclass_hierarchy
+ var colorer = new POSetColorer[MClass]
+ colorer.colorize(poset)
+
+ # The dead methods, still need to provide a dead color symbol
+ var dead_methods = new Array[MMethod]
+
+ # lookup properties to build layout with
+ var mmethods = new HashMap[MClass, Set[PropertyLayoutElement]]
+ var mattributes = new HashMap[MClass, Set[MAttribute]]
+ for mclass in mclasses do
+ mmethods[mclass] = new HashSet[PropertyLayoutElement]
+ mattributes[mclass] = new HashSet[MAttribute]
+ for mprop in self.mainmodule.properties(mclass) do
+ if mprop isa MMethod then
+ if not modelbuilder.toolcontext.opt_colo_dead_methods.value and rta != null and not rta.live_methods.has(mprop) then
+ dead_methods.add(mprop)
+ continue
+ end
+ mmethods[mclass].add(mprop)
+ else if mprop isa MAttribute then
+ mattributes[mclass].add(mprop)
+ end
+ end
+ end
+
+ # Collect all super calls (dead or not)
+ var all_super_calls = new HashSet[MMethodDef]
+ for mmodule in self.mainmodule.in_importation.greaters do
+ for mclassdef in mmodule.mclassdefs do
+ for mpropdef in mclassdef.mpropdefs do
+ if not mpropdef isa MMethodDef then continue
+ if mpropdef.has_supercall then
+ all_super_calls.add(mpropdef)
+ end
+ end
+ end
+ end
+
+ # lookup super calls and add it to the list of mmethods to build layout with
+ var super_calls
+ if rta != null then
+ super_calls = rta.live_super_sends
+ else
+ super_calls = all_super_calls
+ end
+
+ for mmethoddef in super_calls do
+ var mclass = mmethoddef.mclassdef.mclass
+ mmethods[mclass].add(mmethoddef)
+ for descendant in mclass.in_hierarchy(self.mainmodule).smallers do
+ mmethods[descendant].add(mmethoddef)
+ end
+ end