[MLton-commit] r4465

Matthew Fluet MLton@mlton.org
Sat, 6 May 2006 10:44:56 -0700


Added -default-type '<ty><N>' option
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sig
U   mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sml
U   mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun
U   mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/Makefile	2006-05-06 17:25:08 UTC (rev 4464)
+++ mlton/branches/on-20050822-x86_64-branch/Makefile	2006-05-06 17:44:55 UTC (rev 4465)
@@ -222,14 +222,7 @@
 mlbpathmap:
 	touch $(MLBPATHMAP)
 	( echo 'MLTON_ROOT $$(LIB_MLTON_DIR)/sml';	\
-	  echo 'SML_LIB $$(LIB_MLTON_DIR)/sml';		\
-	  echo 'OBJPTR_REP objptr-rep32.sml';		\
-	  echo 'HEADER_WORD header-word32.sml';		\
-	  echo 'SEQ_INDEX seqindex-int32.sml';		\
-	  echo 'DEFAULT_CHAR default-char8.sml';	\
-	  echo 'DEFAULT_INT default-int32.sml';		\
-	  echo 'DEFAULT_REAL default-real64.sml';	\
-	  echo 'DEFAULT_WORD default-word32.sml'; ) 	\
+	  echo 'SML_LIB $$(LIB_MLTON_DIR)/sml'; ) 	\
 		>>$(MLBPATHMAP).tmp
 	mv $(MLBPATHMAP).tmp $(MLBPATHMAP)
 

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sig	2006-05-06 17:25:08 UTC (rev 4464)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sig	2006-05-06 17:44:55 UTC (rev 4465)
@@ -47,6 +47,11 @@
       (* Generate an executable with debugging info. *)
       val debug: bool ref
 
+      val defaultChar: string ref
+      val defaultInt: string ref
+      val defaultReal: string ref
+      val defaultWord: string ref
+
       (* List of pass names to keep diagnostic info on. *)
       val diagPasses: Regexp.Compiled.t list ref
 

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sml	2006-05-06 17:25:08 UTC (rev 4464)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/control/control-flags.sml	2006-05-06 17:44:55 UTC (rev 4465)
@@ -81,6 +81,19 @@
                      default = false,
                      toString = Bool.toString}
 
+val defaultChar = control {name = "defaultChar",
+                           default = "default-char8.sml",
+                           toString = fn s => s}
+val defaultInt = control {name = "defaultInt",
+                          default = "default-int32.sml",
+                          toString = fn s => s}
+val defaultReal = control {name = "defaultReal",
+                           default = "default-real64.sml",
+                           toString = fn s => s}
+val defaultWord = control {name = "defaultWord",
+                           default = "default-word32.sml",
+                           toString = fn s => s}
+
 val diagPasses = 
    control {name = "diag passes",
             default = [],

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun	2006-05-06 17:25:08 UTC (rev 4464)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun	2006-05-06 17:44:55 UTC (rev 4465)
@@ -107,7 +107,21 @@
                                        (!Control.targetArch))},
                {var = "TARGET_OS",
                 path = String.toLower (MLton.Platform.OS.toString
-                                       (!Control.targetOS))}],
+                                       (!Control.targetOS))},
+               {var = "OBJPTR_REP",
+                path = "objptr-rep32.sml"},
+               {var = "HEADER_WORD",
+                path = "header-word32.sml"},
+               {var = "SEQINDEX_INT",
+                path = "seqindex-int32.sml"},
+               {var = "DEFAULT_CHAR",
+                path = !Control.defaultChar},
+               {var = "DEFAULT_INT",
+                path = !Control.defaultInt},
+               {var = "DEFAULT_REAL",
+                path = !Control.defaultReal},
+               {var = "DEFAULT_WORD",
+                path = !Control.defaultWord}],
               List.concat (List.map (!Control.mlbPathMaps, make))])
 
          fun peekPathMap var' =

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2006-05-06 17:25:08 UTC (rev 4464)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2006-05-06 17:44:55 UTC (rev 4465)
@@ -194,6 +194,22 @@
            (fn s => reportAnnotation (s, flag,
                                       Control.Elaborate.processDefault s)))
        end,
+       (Normal, "default-type", " '<ty><N>'", "set default type",
+        SpaceString
+        (fn s => (case s of
+                     "char8" => Control.defaultChar := "default-char8.sml"
+                   | "int8" => Control.defaultInt := "default-int8.sml"
+                   | "int16" => Control.defaultInt := "default-int16.sml"
+                   | "int32" => Control.defaultInt := "default-int32.sml"
+                   | "int64" => Control.defaultInt := "default-int64.sml"
+                   | "intinf" => Control.defaultInt := "default-intinf.sml"
+                   | "real32" => Control.defaultReal := "default-real32.sml"
+                   | "real64" => Control.defaultReal := "default-real64.sml"
+                   | "word8" => Control.defaultWord := "default-word8.sml"
+                   | "word16" => Control.defaultWord := "default-word16.sml"
+                   | "word32" => Control.defaultWord := "default-word32.sml"
+                   | "word64" => Control.defaultWord := "default-word64.sml"
+                   | _ => usage (concat ["invalid -default-type flag: ", s])))),
        (Expert, "diag-pass", " <pass>", "keep diagnostic info for pass",
         SpaceString 
         (fn s =>