From e867303fe58df5a92fbda3edcec5ace9a19256f6 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 13 Feb 2009 11:48:05 -0500 Subject: [PATCH] Remove -attr-sim option (was broken) and related classes. --- src/compiling/compiling_base.nit | 1 - src/compiling/compiling_global.nit | 51 +++--------------------------------- src/nitc.nit | 4 +-- 3 files changed, 4 insertions(+), 52 deletions(-) diff --git a/src/compiling/compiling_base.nit b/src/compiling/compiling_base.nit index 93ba9fe..6ddfaeb 100644 --- a/src/compiling/compiling_base.nit +++ b/src/compiling/compiling_base.nit @@ -22,7 +22,6 @@ private import utils redef class ToolContext readable writable attr _global: Bool = false - readable writable attr _attr_sim: Bool = false readable writable attr _compdir: String readable writable attr _clibdir: String readable writable attr _bindir: String diff --git a/src/compiling/compiling_global.nit b/src/compiling/compiling_global.nit index f79a631..016ebf9 100644 --- a/src/compiling/compiling_global.nit +++ b/src/compiling/compiling_global.nit @@ -105,9 +105,6 @@ redef class MMGlobalProperty end redef class MMSrcLocalClass - # The table element of the attribute position (for accessor simulation) - readable attr _base_attr_pos: TableEltBaseAttrPos - # The table element of the subtype check readable attr _class_color_pos: TableEltClassColorPos @@ -151,12 +148,7 @@ redef class MMSrcLocalClass clt.add(new TableEltSuperPos(p)) end end - if tc.attr_sim and not intro_attributes.is_empty then - _base_attr_pos = new TableEltBaseAttrPos(self) - clt.add(_base_attr_pos) - else - module_table.append(ilt) - end + module_table.append(ilt) module_table.append(clt) end end @@ -288,7 +280,7 @@ redef class MMSrcModule if cte.length > 0 then ctab.add(cte) end - if not cctx.attr_sim and ite.length > 0 then + if ite.length > 0 then itab.add(ite) end end @@ -322,14 +314,6 @@ redef class MMSrcModule cc.instance_table = scc.instance_table.to_a append_to_table(ga, cc.instance_table, cc.instance_layout) end - - if cctx.attr_sim then - cc.instance_table = build_tables(ga, c, itab) - for sc in c.cshe.greaters_and_self do - var scc = ga.compiled_classes[sc.global] - append_to_table(cc, cc.instance_table, scc.instance_layout) - end - end end return ga @@ -511,14 +495,7 @@ redef class MMSrcModule if p.local_class == c then if pg.intro == p then if p isa MMAttribute then - if v.tc.attr_sim then - var bc = pg.local_class - assert bc isa MMSrcLocalClass - var s = bc.base_attr_pos.symbol - v.add_decl("#define {pg.attr_access}(recv) ATTRS(recv, {s}, {pg.pos_of})") - else - v.add_decl("#define {pg.attr_access}(recv) ATTR(recv, {pg.color_id})") - end + v.add_decl("#define {pg.attr_access}(recv) ATTR(recv, {pg.color_id})") else if p isa MMMethod then v.add_decl("#define {pg.meth_call}(recv) (({p.cname}_t)CALL((recv), {pg.color_id}))") end @@ -699,28 +676,6 @@ special TableEltClassPos init(c) do super end -class TableEltBaseAttrPos -special LocalTableElt - attr _local_class: MMSrcLocalClass - redef meth symbol do return "COLOR_{_local_class.module}_{_local_class.name}_BASEATTR" - redef meth value(ga) - do - return "{ga.color(self)} /* BaseAttrPos of {_local_class} */" - end - - redef meth compile_to_c(v, c) - do - var ga = v.global_analysis - var cc = ga.compiled_classes[c.global] - return "{cc.color(_local_class.instance_layout.first)} /* {ga.color(self)}: Base attribut offset of {_local_class.module}::{_local_class} in {c} */" - end - - init(c: MMSrcLocalClass) - do - _local_class = c - end -end - class TableEltComposite special TableElt attr _table: Array[LocalTableElt] diff --git a/src/nitc.nit b/src/nitc.nit index 658dbf4..57ce45e 100644 --- a/src/nitc.nit +++ b/src/nitc.nit @@ -26,7 +26,6 @@ special AbstractCompiler readable attr _opt_output: OptionString = new OptionString("Output file", "-o", "--output") readable attr _opt_boost: OptionBool = new OptionBool("Optimize compilation", "-O", "--boost") readable attr _opt_no_cc: OptionBool = new OptionBool("Do not invoke C compiler", "--no_cc") - readable attr _opt_attr_sim: OptionBool = new OptionBool("Use attribute simulation", "--attr-sim") readable attr _opt_global: OptionBool = new OptionBool("Use global compilation", "--global") readable attr _opt_clibdir: OptionString = new OptionString("NIT C library directory", "--clibdir") readable attr _opt_bindir: OptionString = new OptionString("NIT tools directory", "--bindir") @@ -36,7 +35,7 @@ special AbstractCompiler init do super - option_context.add_option(opt_output, opt_boost, opt_no_cc, opt_attr_sim, opt_global, opt_clibdir, opt_bindir, opt_compdir, opt_extension_prefix) + option_context.add_option(opt_output, opt_boost, opt_no_cc, opt_global, opt_clibdir, opt_bindir, opt_compdir, opt_extension_prefix) end redef meth process_options @@ -47,7 +46,6 @@ special AbstractCompiler no_cc = opt_no_cc.value ext_prefix = opt_extension_prefix.value if ext_prefix == null then ext_prefix = "" - attr_sim = opt_attr_sim.value global = opt_global.value compdir = opt_compdir.value if compdir == null then -- 1.7.9.5