- redef fun generate_check_init_instance(mtype)
- do
- if self.modelbuilder.toolcontext.opt_no_check_initialization.value then return
-
- var v = self.new_visitor
- var c_name = mtype.mclass.c_name
- var res = new RuntimeVariable("self", mtype, mtype)
- self.provide_declaration("CHECK_NEW_{c_name}", "void CHECK_NEW_{c_name}({mtype.ctype});")
- v.add_decl("/* allocate {mtype} */")
- v.add_decl("void CHECK_NEW_{c_name}({mtype.ctype} {res}) \{")
- if runtime_type_analysis.live_classes.has(mtype.mclass) then
- self.generate_check_attr(v, res, mtype)
- else
- v.add_abort("{mtype.mclass} is DEAD")
- end
- v.add("\}")
- end
-