diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-07-23 14:30:46 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-07-25 17:25:26 -0400 |
commit | cb495b3cb416be82e36dbb4eca10a68743ebc549 (patch) | |
tree | ecddeb512c0ff0f33f9ef2afc4502e3354779eaf /compiler/rename/RnSource.hs | |
parent | e07f0e2bec525a147518fceb139cad402e00ed8c (diff) | |
download | haskell-cb495b3cb416be82e36dbb4eca10a68743ebc549.tar.gz |
Make DefUses = OrdList DefUse
Before, `type DefUses = [DefUse]`. But lists are a terrible choice of
data structure here, as we frequently append to the right of a
`DefUses`, which yields some displeasing asymptotics. Let's instead
use `OrdList`, which has constant-time appending to the right.
This is one step on the way to #10347.
Diffstat (limited to 'compiler/rename/RnSource.hs')
-rw-r--r-- | compiler/rename/RnSource.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index a9b3c3f283..aea4b0d5eb 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -62,6 +62,7 @@ import ListSetOps ( findDupsEq, removeDups, equivClasses ) import Digraph ( SCC, flattenSCC, flattenSCCs, Node(..) , stronglyConnCompFromEdgedVerticesUniq ) import UniqSet +import OrdList import qualified GHC.LanguageExtensions as LangExt import Control.Monad @@ -217,7 +218,7 @@ rnSrcDecls group@(HsGroup { hs_valds = val_decls, src_fvs5, src_fvs6, src_fvs7] ; -- It is tiresome to gather the binders from type and class decls - src_dus = [other_def] `plusDU` bind_dus `plusDU` usesOnly other_fvs ; + src_dus = unitOL other_def `plusDU` bind_dus `plusDU` usesOnly other_fvs ; -- Instance decls may have occurrences of things bound in bind_dus -- so we must put other_fvs last |