-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add own version of
OverridingBool
(#2764)
Fixes #2754 (cherry picked from commit 1d49cd2) # Conflicts: # clash-lib/clash-lib.cabal # clash-lib/src/Clash/Driver/Types.hs
- Loading branch information
1 parent
5c3f119
commit dd82b3e
Showing
12 changed files
with
60 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{-| | ||
Copyright : (C) 2024, Martijn Bastiaan | ||
License : BSD2 (see the file LICENSE) | ||
Maintainer : QBayLogic B.V. <[email protected]> | ||
-} | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
|
||
module Clash.Driver.Bool where | ||
|
||
import Control.DeepSeq (NFData) | ||
import Data.Hashable (Hashable) | ||
import GHC.Generics (Generic) | ||
|
||
#if MIN_VERSION_ghc(9,4,0) | ||
import qualified GHC.Data.Bool as Ghc | ||
#elif MIN_VERSION_ghc(9,0,0) | ||
import qualified GHC.Utils.Misc as Ghc | ||
#else | ||
import qualified Util as Ghc | ||
#endif | ||
|
||
data OverridingBool = Auto | Never | Always | ||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Hashable, Generic, NFData) | ||
|
||
toGhcOverridingBool :: OverridingBool -> Ghc.OverridingBool | ||
toGhcOverridingBool Auto = Ghc.Auto | ||
toGhcOverridingBool Never = Ghc.Never | ||
toGhcOverridingBool Always = Ghc.Always | ||
|
||
fromGhcOverridingBool :: Ghc.OverridingBool -> OverridingBool | ||
fromGhcOverridingBool Ghc.Auto = Auto | ||
fromGhcOverridingBool Ghc.Never = Never | ||
fromGhcOverridingBool Ghc.Always = Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters