David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
-
87282f89
by David Eichmann at 2026-06-18T17:07:56+01:00
2 changed files:
Changes:
| ... | ... | @@ -106,6 +106,7 @@ module GHC.Cmm.CLabel ( |
| 106 | 106 | labelDynamic,
|
| 107 | 107 | isLocalCLabel,
|
| 108 | 108 | mayRedirectTo,
|
| 109 | + isSRTInfoLabel,
|
|
| 109 | 110 | isInfoTableLabel,
|
| 110 | 111 | isCmmInfoTableLabel,
|
| 111 | 112 | isConInfoTableLabel,
|
| ... | ... | @@ -730,6 +731,27 @@ mkOutOfBoundsAccessLabel = mkForeignLabel (fsLit "rtsOutOfBoundsAccess") |
| 730 | 731 | mkMemcpyRangeOverlapLabel = mkForeignLabel (fsLit "rtsMemcpyRangeOverlap") ForeignLabelInExternalPackage ForeignLabelIsFunction
|
| 731 | 732 | mkMUT_VAR_CLEAN_infoLabel = CmmLabel rtsUnitId (NeedExternDecl False) (fsLit "stg_MUT_VAR_CLEAN") CmmInfo
|
| 732 | 733 | |
| 734 | +isSRTInfoLabel :: CLabel -> Bool
|
|
| 735 | +isSRTInfoLabel clbl = case clbl of
|
|
| 736 | + CmmLabel _ _ lbl CmmInfo ->
|
|
| 737 | + lbl == fsLit "stg_SRT_1"
|
|
| 738 | + || lbl == fsLit "stg_SRT_2"
|
|
| 739 | + || lbl == fsLit "stg_SRT_3"
|
|
| 740 | + || lbl == fsLit "stg_SRT_4"
|
|
| 741 | + || lbl == fsLit "stg_SRT_5"
|
|
| 742 | + || lbl == fsLit "stg_SRT_6"
|
|
| 743 | + || lbl == fsLit "stg_SRT_7"
|
|
| 744 | + || lbl == fsLit "stg_SRT_8"
|
|
| 745 | + || lbl == fsLit "stg_SRT_9"
|
|
| 746 | + || lbl == fsLit "stg_SRT_10"
|
|
| 747 | + || lbl == fsLit "stg_SRT_11"
|
|
| 748 | + || lbl == fsLit "stg_SRT_12"
|
|
| 749 | + || lbl == fsLit "stg_SRT_13"
|
|
| 750 | + || lbl == fsLit "stg_SRT_14"
|
|
| 751 | + || lbl == fsLit "stg_SRT_15"
|
|
| 752 | + || lbl == fsLit "stg_SRT_16"
|
|
| 753 | + _ -> False
|
|
| 754 | + |
|
| 733 | 755 | mkSRTInfoLabel :: Int -> CLabel
|
| 734 | 756 | mkSRTInfoLabel n = CmmLabel rtsUnitId (NeedExternDecl False) lbl CmmInfo
|
| 735 | 757 | where
|
| ... | ... | @@ -33,7 +33,7 @@ import GHC.CmmToAsm.Ppr |
| 33 | 33 | import GHC.Cmm hiding (topInfoTable)
|
| 34 | 34 | import GHC.Cmm.Dataflow.Label
|
| 35 | 35 | import GHC.Cmm.BlockId
|
| 36 | -import GHC.Cmm.CLabel
|
|
| 36 | +import GHC.Cmm.CLabel as CLabel
|
|
| 37 | 37 | import GHC.Cmm.InitFini
|
| 38 | 38 | import GHC.Cmm.DebugBlock (pprUnwindTable)
|
| 39 | 39 | |
| ... | ... | @@ -96,10 +96,18 @@ pprNatCmmDecl config proc@(CmmProc top_info entry_lbl _ (ListGraph blocks)) = |
| 96 | 96 | )
|
| 97 | 97 | | otherwise = (empty,empty)
|
| 98 | 98 | |
| 99 | + section = case top_info_table of
|
|
| 100 | + Just (CmmStaticsRaw info_lbl _)
|
|
| 101 | + | platformOS platform == OSMinGW32
|
|
| 102 | + && externallyVisibleCLabel info_lbl
|
|
| 103 | + && isSRTInfoLabel info_lbl
|
|
| 104 | + -> ReadOnlyData
|
|
| 105 | + _ -> Text
|
|
| 106 | + |
|
| 99 | 107 | in vcat
|
| 100 | 108 | [ -- section directive. Requires proc_lbl when split-section is enabled to
|
| 101 | 109 | -- use as a subsection name.
|
| 102 | - pprSectionAlign config (Section Text proc_lbl)
|
|
| 110 | + pprSectionAlign config (Section section proc_lbl)
|
|
| 103 | 111 | |
| 104 | 112 | -- section alignment. Note that when there is an info table, we align the
|
| 105 | 113 | -- info table and not the entry code!
|