[Git][ghc/ghc][master] CLabel: fix isInfoTableLabel

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Oct 11 16:51:40 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
dce9f320 by Cheng Shao at 2022-10-11T12:51:19-04:00
CLabel: fix isInfoTableLabel

isInfoTableLabel does not take Cmm info table into account. This patch is required for data section layout of wasm32 NCG to work.

- - - - -


3 changed files:

- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs


Changes:

=====================================
compiler/GHC/Cmm/CLabel.hs
=====================================
@@ -108,6 +108,7 @@ module GHC.Cmm.CLabel (
         isLocalCLabel,
         mayRedirectTo,
         isInfoTableLabel,
+        isCmmInfoTableLabel,
         isConInfoTableLabel,
         isIdLabel,
         isTickyLabel,
@@ -794,8 +795,14 @@ isInfoTableLabel (IdLabel _ _ InfoTable)      = True
 isInfoTableLabel (IdLabel _ _ LocalInfoTable) = True
 isInfoTableLabel (IdLabel _ _ ConInfoTable {})   = True
 isInfoTableLabel (IdLabel _ _ BlockInfoTable) = True
+isInfoTableLabel (CmmLabel _ _ _ CmmInfo)     = True
 isInfoTableLabel _                            = False
 
+-- | Whether label points to an info table defined in Cmm
+isCmmInfoTableLabel :: CLabel -> Bool
+isCmmInfoTableLabel (CmmLabel _ _ _ CmmInfo) = True
+isCmmInfoTableLabel _ = False
+
 -- | Whether label is points to constructor info table
 isConInfoTableLabel :: CLabel -> Bool
 isConInfoTableLabel (IdLabel _ _ ConInfoTable {})   = True


=====================================
compiler/GHC/CmmToAsm/AArch64/Ppr.hs
=====================================
@@ -195,7 +195,7 @@ pprLabelType' platform lbl =
     text "@object"
   where
     functionOkInfoTable = platformTablesNextToCode platform &&
-      isInfoTableLabel lbl && not (isConInfoTableLabel lbl)
+      isInfoTableLabel lbl && not (isCmmInfoTableLabel lbl) && not (isConInfoTableLabel lbl)
 
 -- this is called pprTypeAndSizeDecl in PPC.Ppr
 pprTypeDecl :: Platform -> CLabel -> SDoc


=====================================
compiler/GHC/CmmToAsm/X86/Ppr.hs
=====================================
@@ -254,7 +254,7 @@ pprLabelType' platform lbl =
     but mess up with the relocation. https://phabricator.haskell.org/D4730
     -}
     functionOkInfoTable = platformTablesNextToCode platform &&
-      isInfoTableLabel lbl && not (isConInfoTableLabel lbl)
+      isInfoTableLabel lbl && not (isCmmInfoTableLabel lbl) && not (isConInfoTableLabel lbl)
 
 
 pprTypeDecl :: Platform -> CLabel -> SDoc



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dce9f320ce7275fa97f49abef604abbc3b0f9a9c
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/20221011/87392d47/attachment-0001.html>


More information about the ghc-commits mailing list