diff options
author | Andre Marianiello <andremarianiello@users.noreply.github.com> | 2022-05-09 18:21:47 -0400 |
---|---|---|
committer | andremarianiello <andre.marianiello@gmail.com> | 2022-05-12 02:15:48 +0000 |
commit | 2fc8d76b5c6b4aadcdee39703f8ba6b8936fa9c8 (patch) | |
tree | 108e7681a556016a2ea07b0d4acdefa94e61fced /compiler/GHC/Cmm | |
parent | 3a022baa1967e2df2ed19341de38b004dc07c04f (diff) | |
download | haskell-2fc8d76b5c6b4aadcdee39703f8ba6b8936fa9c8.tar.gz |
Move CmmParserConfig and PDConfig into GHC.Cmm.Parser.Config
Diffstat (limited to 'compiler/GHC/Cmm')
-rw-r--r-- | compiler/GHC/Cmm/Parser.y | 7 | ||||
-rw-r--r-- | compiler/GHC/Cmm/Parser/Config.hs | 24 | ||||
-rw-r--r-- | compiler/GHC/Cmm/Parser/Monad.hs | 7 |
3 files changed, 27 insertions, 11 deletions
diff --git a/compiler/GHC/Cmm/Parser.y b/compiler/GHC/Cmm/Parser.y index 7150ca9b92..5671521b49 100644 --- a/compiler/GHC/Cmm/Parser.y +++ b/compiler/GHC/Cmm/Parser.y @@ -234,6 +234,7 @@ import GHC.Cmm.Info import GHC.Cmm.BlockId import GHC.Cmm.Lexer import GHC.Cmm.CLabel +import GHC.Cmm.Parser.Config import GHC.Cmm.Parser.Monad hiding (getPlatform, getProfile) import qualified GHC.Cmm.Parser.Monad as PD import GHC.Cmm.CallConv @@ -1492,12 +1493,6 @@ initEnv profile = listToUFM [ ] where platform = profilePlatform profile -data CmmParserConfig = CmmParserConfig - { cmmpParserOpts :: !ParserOpts - , cmmpPDConfig :: !PDConfig - , cmmpStgToCmmConfig :: !StgToCmmConfig - } - parseCmmFile :: CmmParserConfig -> Module -> HomeUnit diff --git a/compiler/GHC/Cmm/Parser/Config.hs b/compiler/GHC/Cmm/Parser/Config.hs new file mode 100644 index 0000000000..399764f8f0 --- /dev/null +++ b/compiler/GHC/Cmm/Parser/Config.hs @@ -0,0 +1,24 @@ +module GHC.Cmm.Parser.Config ( + PDConfig(..) + , CmmParserConfig(..) +) where + +import GHC.Prelude + +import GHC.Platform.Profile + +import GHC.StgToCmm.Config + +import GHC.Parser.Lexer + + +data PDConfig = PDConfig + { pdProfile :: !Profile + , pdSanitizeAlignment :: !Bool -- ^ Insert alignment checks (cf @-falignment-sanitisation@) + } + +data CmmParserConfig = CmmParserConfig + { cmmpParserOpts :: !ParserOpts + , cmmpPDConfig :: !PDConfig + , cmmpStgToCmmConfig :: !StgToCmmConfig + } diff --git a/compiler/GHC/Cmm/Parser/Monad.hs b/compiler/GHC/Cmm/Parser/Monad.hs index b13321d491..30906a9fca 100644 --- a/compiler/GHC/Cmm/Parser/Monad.hs +++ b/compiler/GHC/Cmm/Parser/Monad.hs @@ -20,6 +20,8 @@ module GHC.Cmm.Parser.Monad ( import GHC.Prelude +import GHC.Cmm.Parser.Config + import GHC.Platform import GHC.Platform.Profile @@ -32,11 +34,6 @@ import GHC.Types.SrcLoc import GHC.Unit.Types import GHC.Unit.Home -data PDConfig = PDConfig - { pdProfile :: !Profile - , pdSanitizeAlignment :: !Bool -- ^ Insert alignment checks (cf @-falignment-sanitisation@) - } - newtype PD a = PD { unPD :: PDConfig -> HomeUnit -> PState -> ParseResult a } instance Functor PD where |