Skip to content

Commit

Permalink
Stop duplicating binders in loadLocalModule (#2564)
Browse files Browse the repository at this point in the history
Since the refactor in c8f2bbd
`loadLocalModule` was duplicating all (top level) binders contained
in local modules.
Because `loadExternalExprs` already puts all `binders` in `loaded0`.

This led to duplicate PrimGuard warnings like seen in #2561 and possibly
more duplicate work elsewhere.

Fixes #2561
  • Loading branch information
leonschoorl authored Aug 21, 2023
1 parent a2c648e commit 06a085b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clash-ghc/src-ghc/Clash/GHC/LoadModules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ loadLocalModule hdl modName = do
localPrims <- findPrimitiveAnnotations hdl binderIds
let loaded1 = loaded0{lbPrims=lbPrims loaded0 <> Seq.fromList localPrims}

let allBinders = concat binders ++ makeRecursiveGroups (Map.assocs (lbBinders loaded0))
let allBinders = makeRecursiveGroups (Map.assocs (lbBinders loaded0))
pure (rootIds, modFamInstEnvs', rootModule, loaded1, allBinders)

nameString :: Name.Name -> String
Expand Down

0 comments on commit 06a085b

Please sign in to comment.