From 163be9e94ed311cf090d70ab5eafddea183dbdcb Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 11 Feb 2016 21:50:33 -0500 Subject: [PATCH] nitc: remove the redundant property `mfree_init` Signed-off-by: Jean Privat --- src/compiler/abstract_compiler.nit | 3 +-- src/compiler/java_compiler.nit | 3 +-- src/modelize/modelize_property.nit | 5 ----- src/rapid_type_analysis.nit | 3 --- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index 07d6826..02e489d 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -3167,8 +3167,7 @@ end redef class AClassdef private fun compile_to_c(v: AbstractCompilerVisitor, mpropdef: MMethodDef, arguments: Array[RuntimeVariable]) do - if mpropdef == self.mfree_init then - assert mpropdef.mproperty.is_root_init + if mpropdef.mproperty.is_root_init then assert arguments.length == 1 if not mpropdef.is_intro then v.supercall(mpropdef, arguments.first.mtype.as(MClassType), arguments) diff --git a/src/compiler/java_compiler.nit b/src/compiler/java_compiler.nit index 7468d28..ec759a2 100644 --- a/src/compiler/java_compiler.nit +++ b/src/compiler/java_compiler.nit @@ -1482,8 +1482,7 @@ end redef class AClassdef private fun compile_to_java(v: JavaCompilerVisitor, mpropdef: MMethodDef, arguments: Array[RuntimeVariable]) do - if mpropdef == self.mfree_init then - assert mpropdef.mproperty.is_root_init + if mpropdef.mproperty.is_root_init then if not mpropdef.is_intro then v.supercall(mpropdef, arguments.first.mtype.as(MClassType), arguments) end diff --git a/src/modelize/modelize_property.nit b/src/modelize/modelize_property.nit index b782f25..03d9951 100644 --- a/src/modelize/modelize_property.nit +++ b/src/modelize/modelize_property.nit @@ -153,7 +153,6 @@ redef class ModelBuilder mpropdef.msignature = msignature mpropdef.new_msignature = msignature mprop.is_init = true - nclassdef.mfree_init = mpropdef self.toolcontext.info("{mclassdef} gets a free empty constructor {mpropdef}{msignature}", 3) the_root_init_mmethod = mprop return @@ -356,7 +355,6 @@ redef class ModelBuilder var msignature = new MSignature(mparameters, null) mpropdef.new_msignature = msignature mpropdef.msignature = new MSignature(new Array[MParameter], null) # always an empty real signature - nclassdef.mfree_init = mpropdef self.toolcontext.info("{mclassdef} gets a free constructor for attributes {mpropdef}{msignature}", 3) mclassdef.mclass.root_init = mpropdef end @@ -488,9 +486,6 @@ end redef class AClassdef # Marker used in `ModelBuilder::build_properties` private var build_properties_is_done = false - - # The free init (implicitely constructed by the class if required) - var mfree_init: nullable MMethodDef = null end redef class MClass diff --git a/src/rapid_type_analysis.nit b/src/rapid_type_analysis.nit index 9a6b117..749dd00 100644 --- a/src/rapid_type_analysis.nit +++ b/src/rapid_type_analysis.nit @@ -258,9 +258,6 @@ 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) end -- 1.7.9.5