[m-rev.] diff: back out support for tabling and foreign enumerations

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Aug 22 02:51:20 AEST 2007


Estimated hours taken: 0
Branches: main

Back out the (broken) support for tabling with foreign enumerations.
(Attempting to treat foreign enumerations like normal ones for the 
purposes of tabling will not work.)

compiler/table_gen.m:
 	Call sorry/2 if we attempt to table a foreign enumeration.

tests/tabling/Mmakefile:
 	Disable the table_foreign_enum test case for now.

Julien.

Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.137
diff -u -r1.137 table_gen.m
--- compiler/table_gen.m	20 Aug 2007 03:36:06 -0000	1.137
+++ compiler/table_gen.m	21 Aug 2007 16:40:49 -0000
@@ -2350,9 +2350,7 @@
      ForeignArg = foreign_arg(ArgVar, yes(ArgName - in_mode), Type,
          native_if_possible),
      (
-        ( TypeCat = type_cat_enum
-        ; TypeCat = type_cat_foreign_enum
-        ),
+        TypeCat = type_cat_enum,
          type_to_ctor_det(Type, TypeCtor),
          module_info_get_type_table(ModuleInfo, TypeDefnTable),
          map.lookup(TypeDefnTable, TypeCtor, TypeDefn),
@@ -2377,6 +2375,9 @@
              cur_table_node_name ++ ", " ++ int_to_string(EnumRange) ++
              ", " ++ ArgName ++ ", " ++ next_table_node_name ++ ");\n"
      ;
+        TypeCat = type_cat_foreign_enum,
+        sorry(this_file, "tabling and foreign enumerations NYI.")
+    ;
          (
              TypeCat = type_cat_int,
              CatString = "int",
@@ -3447,7 +3448,8 @@
  :- pred type_save_category(type_category::in, string::out) is det.

  type_save_category(type_cat_enum,         "enum").
-type_save_category(type_cat_foreign_enum, "enum").
+type_save_category(type_cat_foreign_enum, _) :-
+    sorry(this_file, "tabling and foreign enumerations NYI.").
  type_save_category(type_cat_int,          "int").
  type_save_category(type_cat_char,         "char").
  type_save_category(type_cat_string,       "string").
Index: tests/tabling/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/tabling/Mmakefile,v
retrieving revision 1.47
diff -u -r1.47 Mmakefile
--- tests/tabling/Mmakefile	20 Aug 2007 03:36:22 -0000	1.47
+++ tests/tabling/Mmakefile	21 Aug 2007 16:40:50 -0000
@@ -22,11 +22,15 @@
  	mercury_java_parser_dead_proc_elim_bug \
  	mercury_java_parser_dead_proc_elim_bug2 \
  	oota \
-	table_foreign_enum \
  	table_foreign_output \
  	test_enum \
  	unused_args

+# The following test is currently disabled because tabling and 
+# foreign enumerations are not yet supported.
+#
+# table_foreign_enum 
+
  # Tabling of nondet predicates and deep profiling are (currently)
  # incompatible.
  ifeq "$(findstring profdeep,$(GRADE))" ""

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list