Merge: MModule: new method `add_mclassdef` to avoid incoherent cache state.
Currently, the constructor of `MClassDef` would directly add itself in the `MModule`, like so:
`mmodule.mclassdefs.add(self)`. However, this could out of date `MModule:flatten_mclass_hierarchy`.
If we want better support for model manipulation after all the semantic phases, we need more logic when adding a new `MClassDef` in the hierarchy.
Moreover, this allows better protection since `MClassDef` no longer needs to know `mmodule.mclassdefs`.
Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
Pull-Request: #2777
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>