Skip to content

Commit

Permalink
Load all unfoldings on GHC 9.4+
Browse files Browse the repository at this point in the history
GHC 9.4+ differentiates between regular unfoldings and unfoldings
of loop breakers. Previously we wouldn't load unfoldings of loop
breakers, unintentionally marking them as primitives. Now we load
all unfoldings from interface files, even loop breakers.
  • Loading branch information
christiaanb committed Aug 28, 2023
1 parent 133b936 commit 1366748
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clash-ghc/src-ghc/Clash/GHC/LoadInterfaceFiles.hs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ loadExprFromTyThing :: CoreSyn.CoreBndr -> GHC.TyThing -> Maybe CoreSyn.CoreExpr
loadExprFromTyThing bndr tyThing = case tyThing of
GHC.AnId _id | Var.isId _id ->
let _idInfo = Var.idInfo _id
#if MIN_VERSION_ghc(9,4,0)
unfolding = IdInfo.realUnfoldingInfo _idInfo
#else
unfolding = IdInfo.unfoldingInfo _idInfo
#endif
in case unfolding of
CoreSyn.CoreUnfolding {} ->
Just (CoreSyn.unfoldingTemplate unfolding)
Expand Down

0 comments on commit 1366748

Please sign in to comment.