Explorar el Código

Basic variables uses are now propagated like constants to save stack space

Taddeus Kroes hace 12 años
padre
commit
dace7f46a0
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      phases/constprop.ml

+ 4 - 1
phases/constprop.ml

@@ -21,7 +21,10 @@ open Util
 let is_const_name name =
   Str.string_match (Str.regexp "^.+\\$\\$[0-9]+$") name 0
 
-let is_const = function Const _ -> true | _ -> false
+let is_const = function
+  | Const _
+  | VarUse (_, None, _) -> true
+  | _ -> false
 
 (* Play-it-safe side effect analysis: only return true for variables and
  * constants, since these are targeted in arithmetic simplification (in