[Git][ghc/ghc][ghc-9.0] 3 commits: Bump Cabal submodule to 3.4.0.0-rc5

Ben Gamari gitlab at gitlab.haskell.org
Mon Dec 14 22:50:01 UTC 2020



Ben Gamari pushed to branch ghc-9.0 at Glasgow Haskell Compiler / GHC


Commits:
3a1af9bf by Ben Gamari at 2020-12-14T10:31:58-05:00
Bump Cabal submodule to 3.4.0.0-rc5

- - - - -
f081501e by Andreas Klebinger at 2020-12-14T10:31:58-05:00
RegAlloc: Add missing raPlatformfield to RegAllocStatsSpill

Fixes #18994

Co-Author: Benjamin Maurer <maurer.benjamin at gmail.com>
(cherry picked from commit 3e3555cc9c2a9f5246895f151259fd2a81621f38)

- - - - -
ca506ea7 by Shayne Fletcher at 2020-12-14T10:31:58-05:00
Fix bad span calculations of post qualified imports

(cherry picked from commit 4a437bc19d2026845948356a932b2cac2417eb12)

- - - - -


7 changed files:

- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
- compiler/GHC/Parser.y
- libraries/Cabal
- testsuite/tests/module/all.T
- + testsuite/tests/module/mod185.hs
- + testsuite/tests/module/mod185.stderr


Changes:

=====================================
compiler/GHC/CmmToAsm/Reg/Graph.hs
=====================================
@@ -278,7 +278,8 @@ regAlloc_spin config spinCount triv regsFree slotsFree slotsCount debug_codeGrap
                         , raCoalesced   = rmCoalesce
                         , raSpillStats  = spillStats
                         , raSpillCosts  = spillCosts
-                        , raSpilled     = code_spilled }
+                        , raSpilled     = code_spilled
+                        , raPlatform    = platform }
 
                 -- Bundle up all the register allocator statistics.
                 --   .. but make sure to drop them on the floor if they're not


=====================================
compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
=====================================
@@ -73,7 +73,11 @@ data RegAllocStats statics instr
         , raSpillCosts  :: SpillCostInfo
 
           -- | Code with spill instructions added.
-        , raSpilled     :: [LiveCmmDecl statics instr] }
+        , raSpilled     :: [LiveCmmDecl statics instr]
+
+          -- | Target platform
+        , raPlatform    :: !Platform
+        }
 
 
         -- a successful coloring


=====================================
compiler/GHC/Parser.y
=====================================
@@ -967,18 +967,20 @@ importdecls_semi
 importdecl :: { LImportDecl GhcPs }
         : 'import' maybe_src maybe_safe optqualified maybe_pkg modid optqualified maybeas maybeimpspec
                 {% do {
-                  ; checkImportDecl $4 $7
-                  ; ams (L (comb4 $1 $6 (snd $8) $9) $
+                  ; let { ; mPreQual = unLoc $4
+                          ; mPostQual = unLoc $7 }
+                  ; checkImportDecl mPreQual mPostQual
+                  ; ams (L (comb5 $1 $6 $7 (snd $8) $9) $
                       ImportDecl { ideclExt = noExtField
                                   , ideclSourceSrc = snd $ fst $2
                                   , ideclName = $6, ideclPkgQual = snd $5
                                   , ideclSource = snd $2, ideclSafe = snd $3
-                                  , ideclQualified = importDeclQualifiedStyle $4 $7
+                                  , ideclQualified = importDeclQualifiedStyle mPreQual mPostQual
                                   , ideclImplicit = False
                                   , ideclAs = unLoc (snd $8)
                                   , ideclHiding = unLoc $9 })
-                         (mj AnnImport $1 : fst (fst $2) ++ fst $3 ++ fmap (mj AnnQualified) (maybeToList $4)
-                                          ++ fst $5 ++ fmap (mj AnnQualified) (maybeToList $7) ++ fst $8)
+                         (mj AnnImport $1 : fst (fst $2) ++ fst $3 ++ fmap (mj AnnQualified) (maybeToList mPreQual)
+                                          ++ fst $5 ++ fmap (mj AnnQualified) (maybeToList mPostQual) ++ fst $8)
                   }
                 }
 
@@ -1002,9 +1004,9 @@ maybe_pkg :: { ([AddAnn],Maybe StringLiteral) }
                         ; return ([mj AnnPackageName $1], Just (StringLiteral (getSTRINGs $1) pkgFS)) } }
         | {- empty -}                           { ([],Nothing) }
 
-optqualified :: { Maybe (Located Token) }
-        : 'qualified'                           { Just $1 }
-        | {- empty -}                           { Nothing }
+optqualified :: { Located (Maybe (Located Token)) }
+        : 'qualified'                           { sL1 $1 (Just $1) }
+        | {- empty -}                           { noLoc Nothing }
 
 maybeas :: { ([AddAnn],Located (Maybe (Located ModuleName))) }
         : 'as' modid                           { ([mj AnnAs $1]
@@ -3754,6 +3756,11 @@ comb4 a b c d = a `seq` b `seq` c `seq` d `seq`
     (combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
                 combineSrcSpans (getLoc c) (getLoc d))
 
+comb5 :: Located a -> Located b -> Located c -> Located d -> Located e -> SrcSpan
+comb5 a b c d e = a `seq` b `seq` c `seq` d `seq` e `seq`
+    (combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $
+       combineSrcSpans (getLoc c) $ combineSrcSpans (getLoc d) (getLoc e))
+
 -- strict constructor version:
 {-# INLINE sL #-}
 sL :: SrcSpan -> a -> Located a


=====================================
libraries/Cabal
=====================================
@@ -1 +1 @@
-Subproject commit 5aea8a4b8463e1ae95272e190a1022764164294f
+Subproject commit 7907a676ada3a5944cfa3b45e23deda7496767cf


=====================================
testsuite/tests/module/all.T
=====================================
@@ -268,6 +268,7 @@ test('mod181', normal, compile, [''])
 test('mod182', normal, compile_fail, [''])
 test('mod183', normal, compile_fail, [''])
 test('mod184', normal, compile, ['-Wprepositive-qualified-module'])
+test('mod185', normal, compile, ['-ddump-parsed-ast'])
 
 test('T1148', normal, compile, [''])
 test('T1074', normal, compile, [''])


=====================================
testsuite/tests/module/mod185.hs
=====================================
@@ -0,0 +1,5 @@
+{-# LANGUAGE ImportQualifiedPost #-}
+-- The span of the import decl should include the 'qualified' keyword.
+import Prelude qualified
+
+main = Prelude.undefined


=====================================
testsuite/tests/module/mod185.stderr
=====================================
@@ -0,0 +1,62 @@
+==================== Parser AST ====================
+
+({ mod185.hs:1:1 }
+ (HsModule
+  (VirtualBraces
+   (1))
+  (Nothing)
+  (Nothing)
+  [({ mod185.hs:3:1-24 }
+    (ImportDecl
+     (NoExtField)
+     (NoSourceText)
+     ({ mod185.hs:3:8-14 }
+      {ModuleName: Prelude})
+     (Nothing)
+     (NotBoot)
+     (False)
+     (QualifiedPost)
+     (False)
+     (Nothing)
+     (Nothing)))]
+  [({ mod185.hs:5:1-24 }
+    (ValD
+     (NoExtField)
+     (FunBind
+      (NoExtField)
+      ({ mod185.hs:5:1-4 }
+       (Unqual
+        {OccName: main}))
+      (MG
+       (NoExtField)
+       ({ mod185.hs:5:1-24 }
+        [({ mod185.hs:5:1-24 }
+          (Match
+           (NoExtField)
+           (FunRhs
+            ({ mod185.hs:5:1-4 }
+             (Unqual
+              {OccName: main}))
+            (Prefix)
+            (NoSrcStrict))
+           []
+           (GRHSs
+            (NoExtField)
+            [({ mod185.hs:5:6-24 }
+              (GRHS
+               (NoExtField)
+               []
+               ({ mod185.hs:5:8-24 }
+                (HsVar
+                 (NoExtField)
+                 ({ mod185.hs:5:8-24 }
+                  (Qual
+                   {ModuleName: Prelude}
+                   {OccName: undefined}))))))]
+            ({ <no location info> }
+             (EmptyLocalBinds
+              (NoExtField))))))])
+       (FromSource))
+      [])))]
+  (Nothing)
+  (Nothing)))



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/00f07ca5a7f6b51fd94508a8da3a4cbf1ee3b73c...ca506ea7457df6ff971abb65a4f94025813bb737

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/00f07ca5a7f6b51fd94508a8da3a4cbf1ee3b73c...ca506ea7457df6ff971abb65a4f94025813bb737
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/20201214/bd327380/attachment-0001.html>


More information about the ghc-commits mailing list