[Git][ghc/ghc][wip/hadrian-cross-stage2] Build genapply per stage

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Wed Nov 1 10:01:55 UTC 2023



Matthew Pickering pushed to branch wip/hadrian-cross-stage2 at Glasgow Haskell Compiler / GHC


Commits:
d53f92c0 by GHC GitLab CI at 2023-11-01T10:01:48+00:00
Build genapply per stage

- - - - -


4 changed files:

- hadrian/src/Builder.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Default.hs
- utils/genapply/Main.hs


Changes:

=====================================
hadrian/src/Builder.hs
=====================================
@@ -166,7 +166,7 @@ data Builder = Alex
              | Cc CcMode Stage
              | Configure FilePath
              | DeriveConstants
-             | GenApply
+             | GenApply Stage
              | GenPrimopCode
              | Ghc GhcMode Stage
              | GhcPkg GhcPkgMode Stage
@@ -205,7 +205,7 @@ instance NFData   Builder
 builderProvenance :: Builder -> Maybe Context
 builderProvenance = \case
     DeriveConstants  -> context stage0Boot deriveConstants
-    GenApply         -> context stage0Boot genapply
+    GenApply stage   -> context (predStage stage) genapply
     GenPrimopCode    -> context stage0Boot genprimopcode
     Ghc _ (Stage0 {})-> Nothing
     Ghc _ stage      -> context (predStage stage) ghc
@@ -330,7 +330,7 @@ instance H.Builder Builder where
                     let env = AddEnv "CONFIG_SHELL" bash
                     cmd' env [Cwd dir] ["sh", path] buildOptions buildArgs
 
-                GenApply -> captureStdout
+                GenApply {} -> captureStdout
 
                 GenPrimopCode -> do
                     stdin <- readFile' input


=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -154,7 +154,7 @@ generatePackageCode context@(Context stage pkg _ _) = do
 
     when (pkg == rts) $ do
         root -/- "**" -/- dir -/- "cmm/AutoApply.cmm" %> \file ->
-            build $ target context GenApply [] [file]
+            build $ target context (GenApply stage) [] [file]
         root -/- "**" -/- dir -/- "include/ghcautoconf.h" %> \_ ->
             need . pure =<< pkgSetupConfigFile context
         root -/- "**" -/- dir -/- "include/ghcplatform.h" %> \_ ->


=====================================
hadrian/src/Settings/Default.hs
=====================================
@@ -70,7 +70,6 @@ stageBootPackages = return
   , hsc2hs
   , compareSizes
   , deriveConstants
-  , genapply
   , genprimopcode
   , unlit
   ]
@@ -111,6 +110,7 @@ stage0Packages = do
              , transformers
              , unlit
              , hp2ps
+             , genapply
              , if windowsHost then win32 else unix
              ]
           ++ [ terminfo | not windowsHost, not cross ]
@@ -160,6 +160,7 @@ stage1Packages = do
         , xhtml
         , haddock
         , hpcBin
+        , genapply
         , if winTarget then win32 else unix
         ] ++
         [ iserv


=====================================
utils/genapply/Main.hs
=====================================
@@ -387,7 +387,7 @@ genMkPAP regstatus macro jump live _ticker disamb
               adj_reg_locs = [ (reg, off - adj + 1) |
                                (reg,off) <- extra_reg_locs ]
               adj = case extra_reg_locs of
-                      (reg, fst_off):_ -> fst_off
+                      (_, fst_off):_ -> fst_off
                       [] -> error "Impossible: genapply.hs : No extra register locations"
               size = snd (last adj_reg_locs) + 1
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d53f92c0b2983e83ed477fccf0affef1cb3ef8b6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d53f92c0b2983e83ed477fccf0affef1cb3ef8b6
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231101/a4cd65b2/attachment-0001.html>


More information about the ghc-commits mailing list