mkIfaceExports: sort the children of AvailTC
authorSimon Marlow <simonmar@microsoft.com>
Tue, 2 Oct 2007 11:49:17 +0000 (11:49 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Tue, 2 Oct 2007 11:49:17 +0000 (11:49 +0000)
This fixes a problem with spurious recompilations: each time a module
was recompiled, the order of the children would change, causing extra
recompilation.

MERGE TO STABLE

compiler/iface/MkIface.lhs

index 4ab1161..8c1b2a0 100644 (file)
@@ -847,7 +847,8 @@ mkIfaceExports exports
                -- Usually just one, but see Note [Original module]
 
        add_for_mod env mod
                -- Usually just one, but see Note [Original module]
 
        add_for_mod env mod
-           = add_one env mod (AvailTC tc_occ names_from_mod)
+           = add_one env mod (AvailTC tc_occ (sort names_from_mod))
+              -- NB. sort the children, we need a canonical order
            where
              names_from_mod = [nameOccName n | n <- ns, nameModule n == mod]
 \end{code}
            where
              names_from_mod = [nameOccName n | n <- ns, nameModule n == mod]
 \end{code}