[MLton-commit] r5159

Vesa Karvonen vesak at mlton.org
Fri Feb 9 08:04:14 PST 2007


Use a bogus region for the generated variable to filter it out from
def-use information.

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

U   mlton/trunk/mlton/elaborate/elaborate-core.fun

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

Modified: mlton/trunk/mlton/elaborate/elaborate-core.fun
===================================================================
--- mlton/trunk/mlton/elaborate/elaborate-core.fun	2007-02-09 15:54:47 UTC (rev 5158)
+++ mlton/trunk/mlton/elaborate/elaborate-core.fun	2007-02-09 16:03:27 UTC (rev 5159)
@@ -1355,20 +1355,17 @@
       open Aexp
 
       local
-         val x = Symbol.fromString "x"
+         val x = Avar.fromSymbol (Symbol.fromString "#", Region.bogus)
+         val xField = Apat.Item.Field (Apat.var x)
+         val xVar = var x
       in
          fun selector (f: Field.t, r: Region.t): t =
-            let
-               val x = Avar.fromSymbol (x, r)
-            in
-               fnn (Vector.new1
-                    (Apat.makeRegion
-                     (Apat.Record {flexible = true,
-                                   items = (Vector.new1
-                                            (f, Apat.Item.Field (Apat.var x)))},
-                      r),
-                     var x))
-            end
+            fnn (Vector.new1
+                 (Apat.makeRegion
+                  (Apat.Record {flexible = true,
+                                items = Vector.new1 (f, xField)},
+                   r),
+                  xVar))
       end
    end
 




More information about the MLton-commit mailing list