When inlining top level functions, guarantee uniqueness.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Wed, 19 Aug 2009 12:42:58 +0000 (14:42 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Wed, 19 Aug 2009 12:42:58 +0000 (14:42 +0200)
cλash/CLasH/Normalize.hs

index cce31864c5f2f0878719c6f42cc4b1d0174d7656..1f0509da5a2ee674aae1117c9150615794152638 100644 (file)
@@ -332,8 +332,10 @@ inlinetoplevel expr@(Var f) | not $ isUserDefined f = do
       -- Get the normalized version
       norm <- Trans.lift $ getNormalized f
       if needsInline norm 
-        then
-          change norm
+        then do
+          -- Regenerate all uniques in the to-be-inlined expression
+          norm_uniqued <- Trans.lift $ genUniques norm
+          change norm_uniqued
         else
           return expr
     else