[MLton-commit] r4686

Stephen Weeks MLton@mlton.org
Mon, 17 Jul 2006 18:01:42 -0700


Fixed bug in usage message on HPPA.  The wrong default alignment was
displayed.

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

U   mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun

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

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2006-07-17 22:05:14 UTC (rev 4685)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2006-07-18 01:01:39 UTC (rev 4686)
@@ -113,6 +113,16 @@
        | _ => false
    end
 
+fun defaultAlignIs8 () =
+   let
+      open Control
+   in
+      case !targetArch of
+         HPPA => true
+       | Sparc => true
+       | _ => false
+   end
+
 fun makeOptions {usage} = 
    let
       val usage = fn s => (ignore (usage s); raise Fail "unreachable")
@@ -139,10 +149,7 @@
       List.map
       (
        [
-       (Normal, "align",
-        case !targetArch of
-           Sparc => " {8|4}"
-         | _ => " {4|8}",
+       (Normal, "align", if defaultAlignIs8 () then " {8|4}" else " {4|8}",
         "object alignment",
         (SpaceString (fn s =>
                       explicitAlign
@@ -572,10 +579,7 @@
       val targetArch = !targetArch
       val () =
          align := (case !explicitAlign of
-                      NONE => (case targetArch of
-                                  Sparc => Align8
-                                | HPPA => Align8
-                                | _ => Align4)
+                      NONE => if defaultAlignIs8 () then Align8 else Align4
                     | SOME a => a)
       val () =
          codegen := (case !explicitCodegen of