{-# LANGUAGE CPP #-}
module CLabel (
CLabel,
ForeignLabelSource(..),
pprDebugCLabel,
mkClosureLabel,
mkSRTLabel,
mkInfoTableLabel,
mkEntryLabel,
mkRednCountsLabel,
mkConInfoTableLabel,
mkApEntryLabel,
mkApInfoTableLabel,
mkClosureTableLabel,
mkBytesLabel,
mkLocalBlockLabel,
mkLocalClosureLabel,
mkLocalInfoTableLabel,
mkLocalClosureTableLabel,
mkBlockInfoTableLabel,
mkBitmapLabel,
mkStringLitLabel,
mkAsmTempLabel,
mkAsmTempDerivedLabel,
mkAsmTempEndLabel,
mkAsmTempDieLabel,
mkSplitMarkerLabel,
mkDirty_MUT_VAR_Label,
mkUpdInfoLabel,
mkBHUpdInfoLabel,
mkIndStaticInfoLabel,
mkMainCapabilityLabel,
mkMAP_FROZEN_CLEAN_infoLabel,
mkMAP_FROZEN_DIRTY_infoLabel,
mkMAP_DIRTY_infoLabel,
mkSMAP_FROZEN_CLEAN_infoLabel,
mkSMAP_FROZEN_DIRTY_infoLabel,
mkSMAP_DIRTY_infoLabel,
mkBadAlignmentLabel,
mkArrWords_infoLabel,
mkSRTInfoLabel,
mkTopTickyCtrLabel,
mkCAFBlackHoleInfoTableLabel,
mkRtsPrimOpLabel,
mkRtsSlowFastTickyCtrLabel,
mkSelectorInfoLabel,
mkSelectorEntryLabel,
mkCmmInfoLabel,
mkCmmEntryLabel,
mkCmmRetInfoLabel,
mkCmmRetLabel,
mkCmmCodeLabel,
mkCmmDataLabel,
mkCmmClosureLabel,
mkRtsApFastLabel,
mkPrimCallLabel,
mkForeignLabel,
addLabelSize,
foreignLabelStdcallInfo,
isBytesLabel,
isForeignLabel,
isSomeRODataLabel,
isStaticClosureLabel,
mkCCLabel, mkCCSLabel,
DynamicLinkerLabelInfo(..),
mkDynamicLinkerLabel,
dynamicLinkerLabelInfo,
mkPicBaseLabel,
mkDeadStripPreventer,
mkHpcTicksLabel,
hasCAF,
needsCDecl, maybeLocalBlockLabel, externallyVisibleCLabel,
isMathFun,
isCFunctionLabel, isGcPtrLabel, labelDynamic,
isLocalCLabel,
toClosureLbl, toSlowEntryLbl, toEntryLbl, toInfoLbl, hasHaskellName,
pprCLabel,
isInfoTableLabel,
isConInfoTableLabel
) where
#include "HsVersions.h"
import GhcPrelude
import IdInfo
import BasicTypes
import {-# SOURCE #-} BlockId (BlockId, mkBlockId)
import Packages
import Module
import Name
import Unique
import PrimOp
import Config
import CostCentre
import Outputable
import FastString
import DynFlags
import Platform
import UniqSet
import Util
import PprCore ( )
data CLabel
=
IdLabel
Name
CafInfo
IdLabelInfo
| CmmLabel
UnitId
FastString
CmmLabelInfo
| RtsLabel
RtsLabelInfo
| LocalBlockLabel
{-# UNPACK #-} !Unique
| ForeignLabel
FastString
(Maybe Int)
ForeignLabelSource
FunctionOrData
| AsmTempLabel
{-# UNPACK #-} !Unique
| AsmTempDerivedLabel
CLabel
FastString
| StringLitLabel
{-# UNPACK #-} !Unique
| CC_Label CostCentre
| CCS_Label CostCentreStack
| DynamicLinkerLabel DynamicLinkerLabelInfo CLabel
| PicBaseLabel
| DeadStripPreventer CLabel
| HpcTicksLabel Module
| SRTLabel
{-# UNPACK #-} !Unique
| LargeBitmapLabel
{-# UNPACK #-} !Unique
deriving CLabel -> CLabel -> Bool
(CLabel -> CLabel -> Bool)
-> (CLabel -> CLabel -> Bool) -> Eq CLabel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CLabel -> CLabel -> Bool
$c/= :: CLabel -> CLabel -> Bool
== :: CLabel -> CLabel -> Bool
$c== :: CLabel -> CLabel -> Bool
Eq
instance Ord CLabel where
compare :: CLabel -> CLabel -> Ordering
compare (IdLabel a1 :: Name
a1 b1 :: CafInfo
b1 c1 :: IdLabelInfo
c1) (IdLabel a2 :: Name
a2 b2 :: CafInfo
b2 c2 :: IdLabelInfo
c2) =
Name -> Name -> Ordering
forall a. Ord a => a -> a -> Ordering
compare Name
a1 Name
a2 Ordering -> Ordering -> Ordering
`thenCmp`
CafInfo -> CafInfo -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CafInfo
b1 CafInfo
b2 Ordering -> Ordering -> Ordering
`thenCmp`
IdLabelInfo -> IdLabelInfo -> Ordering
forall a. Ord a => a -> a -> Ordering
compare IdLabelInfo
c1 IdLabelInfo
c2
compare (CmmLabel a1 :: UnitId
a1 b1 :: FastString
b1 c1 :: CmmLabelInfo
c1) (CmmLabel a2 :: UnitId
a2 b2 :: FastString
b2 c2 :: CmmLabelInfo
c2) =
UnitId -> UnitId -> Ordering
forall a. Ord a => a -> a -> Ordering
compare UnitId
a1 UnitId
a2 Ordering -> Ordering -> Ordering
`thenCmp`
FastString -> FastString -> Ordering
forall a. Ord a => a -> a -> Ordering
compare FastString
b1 FastString
b2 Ordering -> Ordering -> Ordering
`thenCmp`
CmmLabelInfo -> CmmLabelInfo -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CmmLabelInfo
c1 CmmLabelInfo
c2
compare (RtsLabel a1 :: RtsLabelInfo
a1) (RtsLabel a2 :: RtsLabelInfo
a2) = RtsLabelInfo -> RtsLabelInfo -> Ordering
forall a. Ord a => a -> a -> Ordering
compare RtsLabelInfo
a1 RtsLabelInfo
a2
compare (LocalBlockLabel u1 :: Unique
u1) (LocalBlockLabel u2 :: Unique
u2) = Unique -> Unique -> Ordering
nonDetCmpUnique Unique
u1 Unique
u2
compare (ForeignLabel a1 :: FastString
a1 b1 :: Maybe Int
b1 c1 :: ForeignLabelSource
c1 d1 :: FunctionOrData
d1) (ForeignLabel a2 :: FastString
a2 b2 :: Maybe Int
b2 c2 :: ForeignLabelSource
c2 d2 :: FunctionOrData
d2) =
FastString -> FastString -> Ordering
forall a. Ord a => a -> a -> Ordering
compare FastString
a1 FastString
a2 Ordering -> Ordering -> Ordering
`thenCmp`
Maybe Int -> Maybe Int -> Ordering
forall a. Ord a => a -> a -> Ordering
compare Maybe Int
b1 Maybe Int
b2 Ordering -> Ordering -> Ordering
`thenCmp`
ForeignLabelSource -> ForeignLabelSource -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ForeignLabelSource
c1 ForeignLabelSource
c2 Ordering -> Ordering -> Ordering
`thenCmp`
FunctionOrData -> FunctionOrData -> Ordering
forall a. Ord a => a -> a -> Ordering
compare FunctionOrData
d1 FunctionOrData
d2
compare (AsmTempLabel u1 :: Unique
u1) (AsmTempLabel u2 :: Unique
u2) = Unique -> Unique -> Ordering
nonDetCmpUnique Unique
u1 Unique
u2
compare (AsmTempDerivedLabel a1 :: CLabel
a1 b1 :: FastString
b1) (AsmTempDerivedLabel a2 :: CLabel
a2 b2 :: FastString
b2) =
CLabel -> CLabel -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CLabel
a1 CLabel
a2 Ordering -> Ordering -> Ordering
`thenCmp`
FastString -> FastString -> Ordering
forall a. Ord a => a -> a -> Ordering
compare FastString
b1 FastString
b2
compare (StringLitLabel u1 :: Unique
u1) (StringLitLabel u2 :: Unique
u2) =
Unique -> Unique -> Ordering
nonDetCmpUnique Unique
u1 Unique
u2
compare (CC_Label a1 :: CostCentre
a1) (CC_Label a2 :: CostCentre
a2) =
CostCentre -> CostCentre -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CostCentre
a1 CostCentre
a2
compare (CCS_Label a1 :: CostCentreStack
a1) (CCS_Label a2 :: CostCentreStack
a2) =
CostCentreStack -> CostCentreStack -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CostCentreStack
a1 CostCentreStack
a2
compare (DynamicLinkerLabel a1 :: DynamicLinkerLabelInfo
a1 b1 :: CLabel
b1) (DynamicLinkerLabel a2 :: DynamicLinkerLabelInfo
a2 b2 :: CLabel
b2) =
DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Ordering
forall a. Ord a => a -> a -> Ordering
compare DynamicLinkerLabelInfo
a1 DynamicLinkerLabelInfo
a2 Ordering -> Ordering -> Ordering
`thenCmp`
CLabel -> CLabel -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CLabel
b1 CLabel
b2
compare PicBaseLabel PicBaseLabel = Ordering
EQ
compare (DeadStripPreventer a1 :: CLabel
a1) (DeadStripPreventer a2 :: CLabel
a2) =
CLabel -> CLabel -> Ordering
forall a. Ord a => a -> a -> Ordering
compare CLabel
a1 CLabel
a2
compare (HpcTicksLabel a1 :: Module
a1) (HpcTicksLabel a2 :: Module
a2) =
Module -> Module -> Ordering
forall a. Ord a => a -> a -> Ordering
compare Module
a1 Module
a2
compare (SRTLabel u1 :: Unique
u1) (SRTLabel u2 :: Unique
u2) =
Unique -> Unique -> Ordering
nonDetCmpUnique Unique
u1 Unique
u2
compare (LargeBitmapLabel u1 :: Unique
u1) (LargeBitmapLabel u2 :: Unique
u2) =
Unique -> Unique -> Ordering
nonDetCmpUnique Unique
u1 Unique
u2
compare IdLabel{} _ = Ordering
LT
compare _ IdLabel{} = Ordering
GT
compare CmmLabel{} _ = Ordering
LT
compare _ CmmLabel{} = Ordering
GT
compare RtsLabel{} _ = Ordering
LT
compare _ RtsLabel{} = Ordering
GT
compare LocalBlockLabel{} _ = Ordering
LT
compare _ LocalBlockLabel{} = Ordering
GT
compare ForeignLabel{} _ = Ordering
LT
compare _ ForeignLabel{} = Ordering
GT
compare AsmTempLabel{} _ = Ordering
LT
compare _ AsmTempLabel{} = Ordering
GT
compare AsmTempDerivedLabel{} _ = Ordering
LT
compare _ AsmTempDerivedLabel{} = Ordering
GT
compare StringLitLabel{} _ = Ordering
LT
compare _ StringLitLabel{} = Ordering
GT
compare CC_Label{} _ = Ordering
LT
compare _ CC_Label{} = Ordering
GT
compare CCS_Label{} _ = Ordering
LT
compare _ CCS_Label{} = Ordering
GT
compare DynamicLinkerLabel{} _ = Ordering
LT
compare _ DynamicLinkerLabel{} = Ordering
GT
compare PicBaseLabel{} _ = Ordering
LT
compare _ PicBaseLabel{} = Ordering
GT
compare DeadStripPreventer{} _ = Ordering
LT
compare _ DeadStripPreventer{} = Ordering
GT
compare HpcTicksLabel{} _ = Ordering
LT
compare _ HpcTicksLabel{} = Ordering
GT
compare SRTLabel{} _ = Ordering
LT
compare _ SRTLabel{} = Ordering
GT
data ForeignLabelSource
= ForeignLabelInPackage UnitId
| ForeignLabelInExternalPackage
| ForeignLabelInThisPackage
deriving (ForeignLabelSource -> ForeignLabelSource -> Bool
(ForeignLabelSource -> ForeignLabelSource -> Bool)
-> (ForeignLabelSource -> ForeignLabelSource -> Bool)
-> Eq ForeignLabelSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ForeignLabelSource -> ForeignLabelSource -> Bool
$c/= :: ForeignLabelSource -> ForeignLabelSource -> Bool
== :: ForeignLabelSource -> ForeignLabelSource -> Bool
$c== :: ForeignLabelSource -> ForeignLabelSource -> Bool
Eq, Eq ForeignLabelSource
Eq ForeignLabelSource =>
(ForeignLabelSource -> ForeignLabelSource -> Ordering)
-> (ForeignLabelSource -> ForeignLabelSource -> Bool)
-> (ForeignLabelSource -> ForeignLabelSource -> Bool)
-> (ForeignLabelSource -> ForeignLabelSource -> Bool)
-> (ForeignLabelSource -> ForeignLabelSource -> Bool)
-> (ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource)
-> (ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource)
-> Ord ForeignLabelSource
ForeignLabelSource -> ForeignLabelSource -> Bool
ForeignLabelSource -> ForeignLabelSource -> Ordering
ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource
$cmin :: ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource
max :: ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource
$cmax :: ForeignLabelSource -> ForeignLabelSource -> ForeignLabelSource
>= :: ForeignLabelSource -> ForeignLabelSource -> Bool
$c>= :: ForeignLabelSource -> ForeignLabelSource -> Bool
> :: ForeignLabelSource -> ForeignLabelSource -> Bool
$c> :: ForeignLabelSource -> ForeignLabelSource -> Bool
<= :: ForeignLabelSource -> ForeignLabelSource -> Bool
$c<= :: ForeignLabelSource -> ForeignLabelSource -> Bool
< :: ForeignLabelSource -> ForeignLabelSource -> Bool
$c< :: ForeignLabelSource -> ForeignLabelSource -> Bool
compare :: ForeignLabelSource -> ForeignLabelSource -> Ordering
$ccompare :: ForeignLabelSource -> ForeignLabelSource -> Ordering
$cp1Ord :: Eq ForeignLabelSource
Ord)
pprDebugCLabel :: CLabel -> SDoc
pprDebugCLabel :: CLabel -> SDoc
pprDebugCLabel lbl :: CLabel
lbl
= case CLabel
lbl of
IdLabel _ _ info :: IdLabelInfo
info-> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> (SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "IdLabel"
SDoc -> SDoc -> SDoc
<> SDoc -> SDoc
whenPprDebug (String -> SDoc
text ":" SDoc -> SDoc -> SDoc
<> String -> SDoc
text (IdLabelInfo -> String
forall a. Show a => a -> String
show IdLabelInfo
info)))
CmmLabel pkg :: UnitId
pkg _name :: FastString
_name _info :: CmmLabelInfo
_info
-> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> (SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "CmmLabel" SDoc -> SDoc -> SDoc
<+> UnitId -> SDoc
forall a. Outputable a => a -> SDoc
ppr UnitId
pkg)
RtsLabel{} -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> (SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "RtsLabel")
ForeignLabel _name :: FastString
_name mSuffix :: Maybe Int
mSuffix src :: ForeignLabelSource
src funOrData :: FunctionOrData
funOrData
-> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> (SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "ForeignLabel"
SDoc -> SDoc -> SDoc
<+> Maybe Int -> SDoc
forall a. Outputable a => a -> SDoc
ppr Maybe Int
mSuffix
SDoc -> SDoc -> SDoc
<+> ForeignLabelSource -> SDoc
forall a. Outputable a => a -> SDoc
ppr ForeignLabelSource
src
SDoc -> SDoc -> SDoc
<+> FunctionOrData -> SDoc
forall a. Outputable a => a -> SDoc
ppr FunctionOrData
funOrData)
_ -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> (SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "other CLabel")
data IdLabelInfo
= Closure
| InfoTable
| Entry
| Slow
| LocalInfoTable
| LocalEntry
| RednCounts
| ConEntry
| ConInfoTable
| ClosureTable
| Bytes
| BlockInfoTable
deriving (IdLabelInfo -> IdLabelInfo -> Bool
(IdLabelInfo -> IdLabelInfo -> Bool)
-> (IdLabelInfo -> IdLabelInfo -> Bool) -> Eq IdLabelInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdLabelInfo -> IdLabelInfo -> Bool
$c/= :: IdLabelInfo -> IdLabelInfo -> Bool
== :: IdLabelInfo -> IdLabelInfo -> Bool
$c== :: IdLabelInfo -> IdLabelInfo -> Bool
Eq, Eq IdLabelInfo
Eq IdLabelInfo =>
(IdLabelInfo -> IdLabelInfo -> Ordering)
-> (IdLabelInfo -> IdLabelInfo -> Bool)
-> (IdLabelInfo -> IdLabelInfo -> Bool)
-> (IdLabelInfo -> IdLabelInfo -> Bool)
-> (IdLabelInfo -> IdLabelInfo -> Bool)
-> (IdLabelInfo -> IdLabelInfo -> IdLabelInfo)
-> (IdLabelInfo -> IdLabelInfo -> IdLabelInfo)
-> Ord IdLabelInfo
IdLabelInfo -> IdLabelInfo -> Bool
IdLabelInfo -> IdLabelInfo -> Ordering
IdLabelInfo -> IdLabelInfo -> IdLabelInfo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: IdLabelInfo -> IdLabelInfo -> IdLabelInfo
$cmin :: IdLabelInfo -> IdLabelInfo -> IdLabelInfo
max :: IdLabelInfo -> IdLabelInfo -> IdLabelInfo
$cmax :: IdLabelInfo -> IdLabelInfo -> IdLabelInfo
>= :: IdLabelInfo -> IdLabelInfo -> Bool
$c>= :: IdLabelInfo -> IdLabelInfo -> Bool
> :: IdLabelInfo -> IdLabelInfo -> Bool
$c> :: IdLabelInfo -> IdLabelInfo -> Bool
<= :: IdLabelInfo -> IdLabelInfo -> Bool
$c<= :: IdLabelInfo -> IdLabelInfo -> Bool
< :: IdLabelInfo -> IdLabelInfo -> Bool
$c< :: IdLabelInfo -> IdLabelInfo -> Bool
compare :: IdLabelInfo -> IdLabelInfo -> Ordering
$ccompare :: IdLabelInfo -> IdLabelInfo -> Ordering
$cp1Ord :: Eq IdLabelInfo
Ord, Int -> IdLabelInfo -> ShowS
[IdLabelInfo] -> ShowS
IdLabelInfo -> String
(Int -> IdLabelInfo -> ShowS)
-> (IdLabelInfo -> String)
-> ([IdLabelInfo] -> ShowS)
-> Show IdLabelInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdLabelInfo] -> ShowS
$cshowList :: [IdLabelInfo] -> ShowS
show :: IdLabelInfo -> String
$cshow :: IdLabelInfo -> String
showsPrec :: Int -> IdLabelInfo -> ShowS
$cshowsPrec :: Int -> IdLabelInfo -> ShowS
Show)
data RtsLabelInfo
= RtsSelectorInfoTable Bool Int
| RtsSelectorEntry Bool Int
| RtsApInfoTable Bool Int
| RtsApEntry Bool Int
| RtsPrimOp PrimOp
| RtsApFast FastString
| RtsSlowFastTickyCtr String
deriving (RtsLabelInfo -> RtsLabelInfo -> Bool
(RtsLabelInfo -> RtsLabelInfo -> Bool)
-> (RtsLabelInfo -> RtsLabelInfo -> Bool) -> Eq RtsLabelInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RtsLabelInfo -> RtsLabelInfo -> Bool
$c/= :: RtsLabelInfo -> RtsLabelInfo -> Bool
== :: RtsLabelInfo -> RtsLabelInfo -> Bool
$c== :: RtsLabelInfo -> RtsLabelInfo -> Bool
Eq, Eq RtsLabelInfo
Eq RtsLabelInfo =>
(RtsLabelInfo -> RtsLabelInfo -> Ordering)
-> (RtsLabelInfo -> RtsLabelInfo -> Bool)
-> (RtsLabelInfo -> RtsLabelInfo -> Bool)
-> (RtsLabelInfo -> RtsLabelInfo -> Bool)
-> (RtsLabelInfo -> RtsLabelInfo -> Bool)
-> (RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo)
-> (RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo)
-> Ord RtsLabelInfo
RtsLabelInfo -> RtsLabelInfo -> Bool
RtsLabelInfo -> RtsLabelInfo -> Ordering
RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo
$cmin :: RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo
max :: RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo
$cmax :: RtsLabelInfo -> RtsLabelInfo -> RtsLabelInfo
>= :: RtsLabelInfo -> RtsLabelInfo -> Bool
$c>= :: RtsLabelInfo -> RtsLabelInfo -> Bool
> :: RtsLabelInfo -> RtsLabelInfo -> Bool
$c> :: RtsLabelInfo -> RtsLabelInfo -> Bool
<= :: RtsLabelInfo -> RtsLabelInfo -> Bool
$c<= :: RtsLabelInfo -> RtsLabelInfo -> Bool
< :: RtsLabelInfo -> RtsLabelInfo -> Bool
$c< :: RtsLabelInfo -> RtsLabelInfo -> Bool
compare :: RtsLabelInfo -> RtsLabelInfo -> Ordering
$ccompare :: RtsLabelInfo -> RtsLabelInfo -> Ordering
$cp1Ord :: Eq RtsLabelInfo
Ord)
data CmmLabelInfo
= CmmInfo
| CmmEntry
| CmmRetInfo
| CmmRet
| CmmData
| CmmCode
| CmmClosure
| CmmPrimCall
deriving (CmmLabelInfo -> CmmLabelInfo -> Bool
(CmmLabelInfo -> CmmLabelInfo -> Bool)
-> (CmmLabelInfo -> CmmLabelInfo -> Bool) -> Eq CmmLabelInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmmLabelInfo -> CmmLabelInfo -> Bool
$c/= :: CmmLabelInfo -> CmmLabelInfo -> Bool
== :: CmmLabelInfo -> CmmLabelInfo -> Bool
$c== :: CmmLabelInfo -> CmmLabelInfo -> Bool
Eq, Eq CmmLabelInfo
Eq CmmLabelInfo =>
(CmmLabelInfo -> CmmLabelInfo -> Ordering)
-> (CmmLabelInfo -> CmmLabelInfo -> Bool)
-> (CmmLabelInfo -> CmmLabelInfo -> Bool)
-> (CmmLabelInfo -> CmmLabelInfo -> Bool)
-> (CmmLabelInfo -> CmmLabelInfo -> Bool)
-> (CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo)
-> (CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo)
-> Ord CmmLabelInfo
CmmLabelInfo -> CmmLabelInfo -> Bool
CmmLabelInfo -> CmmLabelInfo -> Ordering
CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo
$cmin :: CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo
max :: CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo
$cmax :: CmmLabelInfo -> CmmLabelInfo -> CmmLabelInfo
>= :: CmmLabelInfo -> CmmLabelInfo -> Bool
$c>= :: CmmLabelInfo -> CmmLabelInfo -> Bool
> :: CmmLabelInfo -> CmmLabelInfo -> Bool
$c> :: CmmLabelInfo -> CmmLabelInfo -> Bool
<= :: CmmLabelInfo -> CmmLabelInfo -> Bool
$c<= :: CmmLabelInfo -> CmmLabelInfo -> Bool
< :: CmmLabelInfo -> CmmLabelInfo -> Bool
$c< :: CmmLabelInfo -> CmmLabelInfo -> Bool
compare :: CmmLabelInfo -> CmmLabelInfo -> Ordering
$ccompare :: CmmLabelInfo -> CmmLabelInfo -> Ordering
$cp1Ord :: Eq CmmLabelInfo
Ord)
data DynamicLinkerLabelInfo
= CodeStub
| SymbolPtr
| GotSymbolPtr
| GotSymbolOffset
deriving (DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
(DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool)
-> (DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool)
-> Eq DynamicLinkerLabelInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
$c/= :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
== :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
$c== :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
Eq, Eq DynamicLinkerLabelInfo
Eq DynamicLinkerLabelInfo =>
(DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Ordering)
-> (DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool)
-> (DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool)
-> (DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool)
-> (DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool)
-> (DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo)
-> (DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo)
-> Ord DynamicLinkerLabelInfo
DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Ordering
DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo
$cmin :: DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo
max :: DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo
$cmax :: DynamicLinkerLabelInfo
-> DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo
>= :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
$c>= :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
> :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
$c> :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
<= :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
$c<= :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
< :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
$c< :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Bool
compare :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Ordering
$ccompare :: DynamicLinkerLabelInfo -> DynamicLinkerLabelInfo -> Ordering
$cp1Ord :: Eq DynamicLinkerLabelInfo
Ord)
mkSRTLabel :: Unique -> CLabel
mkSRTLabel :: Unique -> CLabel
mkSRTLabel u :: Unique
u = Unique -> CLabel
SRTLabel Unique
u
mkRednCountsLabel :: Name -> CLabel
mkRednCountsLabel :: Name -> CLabel
mkRednCountsLabel name :: Name
name =
Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
NoCafRefs IdLabelInfo
RednCounts
mkLocalClosureLabel :: Name -> CafInfo -> CLabel
mkLocalInfoTableLabel :: Name -> CafInfo -> CLabel
mkLocalClosureTableLabel :: Name -> CafInfo -> CLabel
mkLocalClosureLabel :: Name -> CafInfo -> CLabel
mkLocalClosureLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
Closure
mkLocalInfoTableLabel :: Name -> CafInfo -> CLabel
mkLocalInfoTableLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
LocalInfoTable
mkLocalClosureTableLabel :: Name -> CafInfo -> CLabel
mkLocalClosureTableLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
ClosureTable
mkClosureLabel :: Name -> CafInfo -> CLabel
mkInfoTableLabel :: Name -> CafInfo -> CLabel
mkEntryLabel :: Name -> CafInfo -> CLabel
mkClosureTableLabel :: Name -> CafInfo -> CLabel
mkConInfoTableLabel :: Name -> CafInfo -> CLabel
mkBytesLabel :: Name -> CLabel
mkClosureLabel :: Name -> CafInfo -> CLabel
mkClosureLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
Closure
mkInfoTableLabel :: Name -> CafInfo -> CLabel
mkInfoTableLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
InfoTable
mkEntryLabel :: Name -> CafInfo -> CLabel
mkEntryLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
Entry
mkClosureTableLabel :: Name -> CafInfo -> CLabel
mkClosureTableLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
ClosureTable
mkConInfoTableLabel :: Name -> CafInfo -> CLabel
mkConInfoTableLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
ConInfoTable
mkBytesLabel :: Name -> CLabel
mkBytesLabel name :: Name
name = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
NoCafRefs IdLabelInfo
Bytes
mkBlockInfoTableLabel :: Name -> CafInfo -> CLabel
mkBlockInfoTableLabel :: Name -> CafInfo -> CLabel
mkBlockInfoTableLabel name :: Name
name c :: CafInfo
c = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
name CafInfo
c IdLabelInfo
BlockInfoTable
mkDirty_MUT_VAR_Label, mkSplitMarkerLabel, mkUpdInfoLabel,
mkBHUpdInfoLabel, mkIndStaticInfoLabel, mkMainCapabilityLabel,
mkMAP_FROZEN_CLEAN_infoLabel, mkMAP_FROZEN_DIRTY_infoLabel,
mkMAP_DIRTY_infoLabel,
mkArrWords_infoLabel,
mkTopTickyCtrLabel,
mkCAFBlackHoleInfoTableLabel,
mkSMAP_FROZEN_CLEAN_infoLabel, mkSMAP_FROZEN_DIRTY_infoLabel,
mkSMAP_DIRTY_infoLabel, mkBadAlignmentLabel :: CLabel
mkDirty_MUT_VAR_Label :: CLabel
mkDirty_MUT_VAR_Label = FastString
-> Maybe Int -> ForeignLabelSource -> FunctionOrData -> CLabel
mkForeignLabel (String -> FastString
fsLit "dirty_MUT_VAR") Maybe Int
forall a. Maybe a
Nothing ForeignLabelSource
ForeignLabelInExternalPackage FunctionOrData
IsFunction
mkSplitMarkerLabel :: CLabel
mkSplitMarkerLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "__stg_split_marker") CmmLabelInfo
CmmCode
mkUpdInfoLabel :: CLabel
mkUpdInfoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_upd_frame") CmmLabelInfo
CmmInfo
mkBHUpdInfoLabel :: CLabel
mkBHUpdInfoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_bh_upd_frame" ) CmmLabelInfo
CmmInfo
mkIndStaticInfoLabel :: CLabel
mkIndStaticInfoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_IND_STATIC") CmmLabelInfo
CmmInfo
mkMainCapabilityLabel :: CLabel
mkMainCapabilityLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "MainCapability") CmmLabelInfo
CmmData
mkMAP_FROZEN_CLEAN_infoLabel :: CLabel
mkMAP_FROZEN_CLEAN_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_MUT_ARR_PTRS_FROZEN_CLEAN") CmmLabelInfo
CmmInfo
mkMAP_FROZEN_DIRTY_infoLabel :: CLabel
mkMAP_FROZEN_DIRTY_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_MUT_ARR_PTRS_FROZEN_DIRTY") CmmLabelInfo
CmmInfo
mkMAP_DIRTY_infoLabel :: CLabel
mkMAP_DIRTY_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_MUT_ARR_PTRS_DIRTY") CmmLabelInfo
CmmInfo
mkTopTickyCtrLabel :: CLabel
mkTopTickyCtrLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "top_ct") CmmLabelInfo
CmmData
mkCAFBlackHoleInfoTableLabel :: CLabel
mkCAFBlackHoleInfoTableLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_CAF_BLACKHOLE") CmmLabelInfo
CmmInfo
mkArrWords_infoLabel :: CLabel
mkArrWords_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_ARR_WORDS") CmmLabelInfo
CmmInfo
mkSMAP_FROZEN_CLEAN_infoLabel :: CLabel
mkSMAP_FROZEN_CLEAN_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN") CmmLabelInfo
CmmInfo
mkSMAP_FROZEN_DIRTY_infoLabel :: CLabel
mkSMAP_FROZEN_DIRTY_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY") CmmLabelInfo
CmmInfo
mkSMAP_DIRTY_infoLabel :: CLabel
mkSMAP_DIRTY_infoLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_SMALL_MUT_ARR_PTRS_DIRTY") CmmLabelInfo
CmmInfo
mkBadAlignmentLabel :: CLabel
mkBadAlignmentLabel = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId (String -> FastString
fsLit "stg_badAlignment") CmmLabelInfo
CmmEntry
mkSRTInfoLabel :: Int -> CLabel
mkSRTInfoLabel :: Int -> CLabel
mkSRTInfoLabel n :: Int
n = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
rtsUnitId FastString
lbl CmmLabelInfo
CmmInfo
where
lbl :: FastString
lbl =
case Int
n of
1 -> String -> FastString
fsLit "stg_SRT_1"
2 -> String -> FastString
fsLit "stg_SRT_2"
3 -> String -> FastString
fsLit "stg_SRT_3"
4 -> String -> FastString
fsLit "stg_SRT_4"
5 -> String -> FastString
fsLit "stg_SRT_5"
6 -> String -> FastString
fsLit "stg_SRT_6"
7 -> String -> FastString
fsLit "stg_SRT_7"
8 -> String -> FastString
fsLit "stg_SRT_8"
9 -> String -> FastString
fsLit "stg_SRT_9"
10 -> String -> FastString
fsLit "stg_SRT_10"
11 -> String -> FastString
fsLit "stg_SRT_11"
12 -> String -> FastString
fsLit "stg_SRT_12"
13 -> String -> FastString
fsLit "stg_SRT_13"
14 -> String -> FastString
fsLit "stg_SRT_14"
15 -> String -> FastString
fsLit "stg_SRT_15"
16 -> String -> FastString
fsLit "stg_SRT_16"
_ -> String -> FastString
forall a. String -> a
panic "mkSRTInfoLabel"
mkCmmInfoLabel, mkCmmEntryLabel, mkCmmRetInfoLabel, mkCmmRetLabel,
mkCmmCodeLabel, mkCmmDataLabel, mkCmmClosureLabel
:: UnitId -> FastString -> CLabel
mkCmmInfoLabel :: UnitId -> FastString -> CLabel
mkCmmInfoLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmInfo
mkCmmEntryLabel :: UnitId -> FastString -> CLabel
mkCmmEntryLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmEntry
mkCmmRetInfoLabel :: UnitId -> FastString -> CLabel
mkCmmRetInfoLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmRetInfo
mkCmmRetLabel :: UnitId -> FastString -> CLabel
mkCmmRetLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmRet
mkCmmCodeLabel :: UnitId -> FastString -> CLabel
mkCmmCodeLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmCode
mkCmmDataLabel :: UnitId -> FastString -> CLabel
mkCmmDataLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmData
mkCmmClosureLabel :: UnitId -> FastString -> CLabel
mkCmmClosureLabel pkg :: UnitId
pkg str :: FastString
str = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmClosure
mkLocalBlockLabel :: Unique -> CLabel
mkLocalBlockLabel :: Unique -> CLabel
mkLocalBlockLabel u :: Unique
u = Unique -> CLabel
LocalBlockLabel Unique
u
mkRtsPrimOpLabel :: PrimOp -> CLabel
mkRtsPrimOpLabel :: PrimOp -> CLabel
mkRtsPrimOpLabel primop :: PrimOp
primop = RtsLabelInfo -> CLabel
RtsLabel (PrimOp -> RtsLabelInfo
RtsPrimOp PrimOp
primop)
mkSelectorInfoLabel :: Bool -> Int -> CLabel
mkSelectorEntryLabel :: Bool -> Int -> CLabel
mkSelectorInfoLabel :: Bool -> Int -> CLabel
mkSelectorInfoLabel upd :: Bool
upd off :: Int
off = RtsLabelInfo -> CLabel
RtsLabel (Bool -> Int -> RtsLabelInfo
RtsSelectorInfoTable Bool
upd Int
off)
mkSelectorEntryLabel :: Bool -> Int -> CLabel
mkSelectorEntryLabel upd :: Bool
upd off :: Int
off = RtsLabelInfo -> CLabel
RtsLabel (Bool -> Int -> RtsLabelInfo
RtsSelectorEntry Bool
upd Int
off)
mkApInfoTableLabel :: Bool -> Int -> CLabel
mkApEntryLabel :: Bool -> Int -> CLabel
mkApInfoTableLabel :: Bool -> Int -> CLabel
mkApInfoTableLabel upd :: Bool
upd off :: Int
off = RtsLabelInfo -> CLabel
RtsLabel (Bool -> Int -> RtsLabelInfo
RtsApInfoTable Bool
upd Int
off)
mkApEntryLabel :: Bool -> Int -> CLabel
mkApEntryLabel upd :: Bool
upd off :: Int
off = RtsLabelInfo -> CLabel
RtsLabel (Bool -> Int -> RtsLabelInfo
RtsApEntry Bool
upd Int
off)
mkPrimCallLabel :: PrimCall -> CLabel
mkPrimCallLabel :: PrimCall -> CLabel
mkPrimCallLabel (PrimCall str :: FastString
str pkg :: UnitId
pkg)
= UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
pkg FastString
str CmmLabelInfo
CmmPrimCall
mkForeignLabel
:: FastString
-> Maybe Int
-> ForeignLabelSource
-> FunctionOrData
-> CLabel
mkForeignLabel :: FastString
-> Maybe Int -> ForeignLabelSource -> FunctionOrData -> CLabel
mkForeignLabel str :: FastString
str mb_sz :: Maybe Int
mb_sz src :: ForeignLabelSource
src fod :: FunctionOrData
fod
= FastString
-> Maybe Int -> ForeignLabelSource -> FunctionOrData -> CLabel
ForeignLabel FastString
str Maybe Int
mb_sz ForeignLabelSource
src FunctionOrData
fod
addLabelSize :: CLabel -> Int -> CLabel
addLabelSize :: CLabel -> Int -> CLabel
addLabelSize (ForeignLabel str :: FastString
str _ src :: ForeignLabelSource
src fod :: FunctionOrData
fod) sz :: Int
sz
= FastString
-> Maybe Int -> ForeignLabelSource -> FunctionOrData -> CLabel
ForeignLabel FastString
str (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
sz) ForeignLabelSource
src FunctionOrData
fod
addLabelSize label :: CLabel
label _
= CLabel
label
isBytesLabel :: CLabel -> Bool
isBytesLabel :: CLabel -> Bool
isBytesLabel (IdLabel _ _ Bytes) = Bool
True
isBytesLabel _lbl :: CLabel
_lbl = Bool
False
isForeignLabel :: CLabel -> Bool
isForeignLabel :: CLabel -> Bool
isForeignLabel (ForeignLabel _ _ _ _) = Bool
True
isForeignLabel _lbl :: CLabel
_lbl = Bool
False
isStaticClosureLabel :: CLabel -> Bool
isStaticClosureLabel :: CLabel -> Bool
isStaticClosureLabel (IdLabel _ _ Closure) = Bool
True
isStaticClosureLabel (CmmLabel _ _ CmmClosure) = Bool
True
isStaticClosureLabel _lbl :: CLabel
_lbl = Bool
False
isSomeRODataLabel :: CLabel -> Bool
isSomeRODataLabel :: CLabel -> Bool
isSomeRODataLabel (IdLabel _ _ ClosureTable) = Bool
True
isSomeRODataLabel (IdLabel _ _ ConInfoTable) = Bool
True
isSomeRODataLabel (IdLabel _ _ InfoTable) = Bool
True
isSomeRODataLabel (IdLabel _ _ LocalInfoTable) = Bool
True
isSomeRODataLabel (IdLabel _ _ BlockInfoTable) = Bool
True
isSomeRODataLabel (CmmLabel _ _ CmmInfo) = Bool
True
isSomeRODataLabel _lbl :: CLabel
_lbl = Bool
False
isInfoTableLabel :: CLabel -> Bool
isInfoTableLabel :: CLabel -> Bool
isInfoTableLabel (IdLabel _ _ InfoTable) = Bool
True
isInfoTableLabel (IdLabel _ _ LocalInfoTable) = Bool
True
isInfoTableLabel (IdLabel _ _ ConInfoTable) = Bool
True
isInfoTableLabel (IdLabel _ _ BlockInfoTable) = Bool
True
isInfoTableLabel _ = Bool
False
isConInfoTableLabel :: CLabel -> Bool
isConInfoTableLabel :: CLabel -> Bool
isConInfoTableLabel (IdLabel _ _ ConInfoTable) = Bool
True
isConInfoTableLabel _ = Bool
False
foreignLabelStdcallInfo :: CLabel -> Maybe Int
foreignLabelStdcallInfo :: CLabel -> Maybe Int
foreignLabelStdcallInfo (ForeignLabel _ info :: Maybe Int
info _ _) = Maybe Int
info
foreignLabelStdcallInfo _lbl :: CLabel
_lbl = Maybe Int
forall a. Maybe a
Nothing
mkBitmapLabel :: Unique -> CLabel
mkBitmapLabel :: Unique -> CLabel
mkBitmapLabel uniq :: Unique
uniq = Unique -> CLabel
LargeBitmapLabel Unique
uniq
mkCCLabel :: CostCentre -> CLabel
mkCCSLabel :: CostCentreStack -> CLabel
mkCCLabel :: CostCentre -> CLabel
mkCCLabel cc :: CostCentre
cc = CostCentre -> CLabel
CC_Label CostCentre
cc
mkCCSLabel :: CostCentreStack -> CLabel
mkCCSLabel ccs :: CostCentreStack
ccs = CostCentreStack -> CLabel
CCS_Label CostCentreStack
ccs
mkRtsApFastLabel :: FastString -> CLabel
mkRtsApFastLabel :: FastString -> CLabel
mkRtsApFastLabel str :: FastString
str = RtsLabelInfo -> CLabel
RtsLabel (FastString -> RtsLabelInfo
RtsApFast FastString
str)
mkRtsSlowFastTickyCtrLabel :: String -> CLabel
mkRtsSlowFastTickyCtrLabel :: String -> CLabel
mkRtsSlowFastTickyCtrLabel pat :: String
pat = RtsLabelInfo -> CLabel
RtsLabel (String -> RtsLabelInfo
RtsSlowFastTickyCtr String
pat)
mkHpcTicksLabel :: Module -> CLabel
mkHpcTicksLabel :: Module -> CLabel
mkHpcTicksLabel = Module -> CLabel
HpcTicksLabel
mkDynamicLinkerLabel :: DynamicLinkerLabelInfo -> CLabel -> CLabel
mkDynamicLinkerLabel :: DynamicLinkerLabelInfo -> CLabel -> CLabel
mkDynamicLinkerLabel = DynamicLinkerLabelInfo -> CLabel -> CLabel
DynamicLinkerLabel
dynamicLinkerLabelInfo :: CLabel -> Maybe (DynamicLinkerLabelInfo, CLabel)
dynamicLinkerLabelInfo :: CLabel -> Maybe (DynamicLinkerLabelInfo, CLabel)
dynamicLinkerLabelInfo (DynamicLinkerLabel info :: DynamicLinkerLabelInfo
info lbl :: CLabel
lbl) = (DynamicLinkerLabelInfo, CLabel)
-> Maybe (DynamicLinkerLabelInfo, CLabel)
forall a. a -> Maybe a
Just (DynamicLinkerLabelInfo
info, CLabel
lbl)
dynamicLinkerLabelInfo _ = Maybe (DynamicLinkerLabelInfo, CLabel)
forall a. Maybe a
Nothing
mkPicBaseLabel :: CLabel
mkPicBaseLabel :: CLabel
mkPicBaseLabel = CLabel
PicBaseLabel
mkDeadStripPreventer :: CLabel -> CLabel
mkDeadStripPreventer :: CLabel -> CLabel
mkDeadStripPreventer lbl :: CLabel
lbl = CLabel -> CLabel
DeadStripPreventer CLabel
lbl
mkStringLitLabel :: Unique -> CLabel
mkStringLitLabel :: Unique -> CLabel
mkStringLitLabel = Unique -> CLabel
StringLitLabel
mkAsmTempLabel :: Uniquable a => a -> CLabel
mkAsmTempLabel :: a -> CLabel
mkAsmTempLabel a :: a
a = Unique -> CLabel
AsmTempLabel (a -> Unique
forall a. Uniquable a => a -> Unique
getUnique a
a)
mkAsmTempDerivedLabel :: CLabel -> FastString -> CLabel
mkAsmTempDerivedLabel :: CLabel -> FastString -> CLabel
mkAsmTempDerivedLabel = CLabel -> FastString -> CLabel
AsmTempDerivedLabel
mkAsmTempEndLabel :: CLabel -> CLabel
mkAsmTempEndLabel :: CLabel -> CLabel
mkAsmTempEndLabel l :: CLabel
l = CLabel -> FastString -> CLabel
mkAsmTempDerivedLabel CLabel
l (String -> FastString
fsLit "_end")
mkAsmTempDieLabel :: CLabel -> CLabel
mkAsmTempDieLabel :: CLabel -> CLabel
mkAsmTempDieLabel l :: CLabel
l = CLabel -> FastString -> CLabel
mkAsmTempDerivedLabel CLabel
l (String -> FastString
fsLit "_die")
toClosureLbl :: CLabel -> CLabel
toClosureLbl :: CLabel -> CLabel
toClosureLbl (IdLabel n :: Name
n c :: CafInfo
c _) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
Closure
toClosureLbl (CmmLabel m :: UnitId
m str :: FastString
str _) = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
m FastString
str CmmLabelInfo
CmmClosure
toClosureLbl l :: CLabel
l = String -> SDoc -> CLabel
forall a. HasCallStack => String -> SDoc -> a
pprPanic "toClosureLbl" (CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
l)
toSlowEntryLbl :: CLabel -> CLabel
toSlowEntryLbl :: CLabel -> CLabel
toSlowEntryLbl (IdLabel n :: Name
n _ BlockInfoTable)
= String -> SDoc -> CLabel
forall a. HasCallStack => String -> SDoc -> a
pprPanic "toSlowEntryLbl" (Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr Name
n)
toSlowEntryLbl (IdLabel n :: Name
n c :: CafInfo
c _) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
Slow
toSlowEntryLbl l :: CLabel
l = String -> SDoc -> CLabel
forall a. HasCallStack => String -> SDoc -> a
pprPanic "toSlowEntryLbl" (CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
l)
toEntryLbl :: CLabel -> CLabel
toEntryLbl :: CLabel -> CLabel
toEntryLbl (IdLabel n :: Name
n c :: CafInfo
c LocalInfoTable) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
LocalEntry
toEntryLbl (IdLabel n :: Name
n c :: CafInfo
c ConInfoTable) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
ConEntry
toEntryLbl (IdLabel n :: Name
n _ BlockInfoTable) = Unique -> CLabel
mkLocalBlockLabel (Name -> Unique
nameUnique Name
n)
toEntryLbl (IdLabel n :: Name
n c :: CafInfo
c _) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
Entry
toEntryLbl (CmmLabel m :: UnitId
m str :: FastString
str CmmInfo) = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
m FastString
str CmmLabelInfo
CmmEntry
toEntryLbl (CmmLabel m :: UnitId
m str :: FastString
str CmmRetInfo) = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
m FastString
str CmmLabelInfo
CmmRet
toEntryLbl l :: CLabel
l = String -> SDoc -> CLabel
forall a. HasCallStack => String -> SDoc -> a
pprPanic "toEntryLbl" (CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
l)
toInfoLbl :: CLabel -> CLabel
toInfoLbl :: CLabel -> CLabel
toInfoLbl (IdLabel n :: Name
n c :: CafInfo
c LocalEntry) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
LocalInfoTable
toInfoLbl (IdLabel n :: Name
n c :: CafInfo
c ConEntry) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
ConInfoTable
toInfoLbl (IdLabel n :: Name
n c :: CafInfo
c _) = Name -> CafInfo -> IdLabelInfo -> CLabel
IdLabel Name
n CafInfo
c IdLabelInfo
InfoTable
toInfoLbl (CmmLabel m :: UnitId
m str :: FastString
str CmmEntry) = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
m FastString
str CmmLabelInfo
CmmInfo
toInfoLbl (CmmLabel m :: UnitId
m str :: FastString
str CmmRet) = UnitId -> FastString -> CmmLabelInfo -> CLabel
CmmLabel UnitId
m FastString
str CmmLabelInfo
CmmRetInfo
toInfoLbl l :: CLabel
l = String -> SDoc -> CLabel
forall a. HasCallStack => String -> SDoc -> a
pprPanic "CLabel.toInfoLbl" (CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
l)
hasHaskellName :: CLabel -> Maybe Name
hasHaskellName :: CLabel -> Maybe Name
hasHaskellName (IdLabel n :: Name
n _ _) = Name -> Maybe Name
forall a. a -> Maybe a
Just Name
n
hasHaskellName _ = Maybe Name
forall a. Maybe a
Nothing
hasCAF :: CLabel -> Bool
hasCAF :: CLabel -> Bool
hasCAF (IdLabel _ _ RednCounts) = Bool
False
hasCAF (IdLabel _ MayHaveCafRefs _) = Bool
True
hasCAF _ = Bool
False
needsCDecl :: CLabel -> Bool
needsCDecl :: CLabel -> Bool
needsCDecl (SRTLabel _) = Bool
True
needsCDecl (LargeBitmapLabel _) = Bool
False
needsCDecl (IdLabel _ _ _) = Bool
True
needsCDecl (LocalBlockLabel _) = Bool
True
needsCDecl (StringLitLabel _) = Bool
False
needsCDecl (AsmTempLabel _) = Bool
False
needsCDecl (AsmTempDerivedLabel _ _) = Bool
False
needsCDecl (RtsLabel _) = Bool
False
needsCDecl (CmmLabel pkgId :: UnitId
pkgId _ _)
| UnitId
pkgId UnitId -> UnitId -> Bool
forall a. Eq a => a -> a -> Bool
== UnitId
rtsUnitId = Bool
False
| Bool
otherwise = Bool
True
needsCDecl l :: CLabel
l@(ForeignLabel{}) = Bool -> Bool
not (CLabel -> Bool
isMathFun CLabel
l)
needsCDecl (CC_Label _) = Bool
True
needsCDecl (CCS_Label _) = Bool
True
needsCDecl (HpcTicksLabel _) = Bool
True
needsCDecl (DynamicLinkerLabel {}) = String -> Bool
forall a. String -> a
panic "needsCDecl DynamicLinkerLabel"
needsCDecl PicBaseLabel = String -> Bool
forall a. String -> a
panic "needsCDecl PicBaseLabel"
needsCDecl (DeadStripPreventer {}) = String -> Bool
forall a. String -> a
panic "needsCDecl DeadStripPreventer"
maybeLocalBlockLabel :: CLabel -> Maybe BlockId
maybeLocalBlockLabel :: CLabel -> Maybe BlockId
maybeLocalBlockLabel (LocalBlockLabel uq :: Unique
uq) = BlockId -> Maybe BlockId
forall a. a -> Maybe a
Just (BlockId -> Maybe BlockId) -> BlockId -> Maybe BlockId
forall a b. (a -> b) -> a -> b
$ Unique -> BlockId
mkBlockId Unique
uq
maybeLocalBlockLabel _ = Maybe BlockId
forall a. Maybe a
Nothing
isMathFun :: CLabel -> Bool
isMathFun :: CLabel -> Bool
isMathFun (ForeignLabel fs :: FastString
fs _ _ _) = FastString
fs FastString -> UniqSet FastString -> Bool
forall a. Uniquable a => a -> UniqSet a -> Bool
`elementOfUniqSet` UniqSet FastString
math_funs
isMathFun _ = Bool
False
math_funs :: UniqSet FastString
math_funs :: UniqSet FastString
math_funs = [FastString] -> UniqSet FastString
forall a. Uniquable a => [a] -> UniqSet a
mkUniqSet [
(String -> FastString
fsLit "acos"), (String -> FastString
fsLit "acosf"), (String -> FastString
fsLit "acosh"),
(String -> FastString
fsLit "acoshf"), (String -> FastString
fsLit "acoshl"), (String -> FastString
fsLit "acosl"),
(String -> FastString
fsLit "asin"), (String -> FastString
fsLit "asinf"), (String -> FastString
fsLit "asinl"),
(String -> FastString
fsLit "asinh"), (String -> FastString
fsLit "asinhf"), (String -> FastString
fsLit "asinhl"),
(String -> FastString
fsLit "atan"), (String -> FastString
fsLit "atanf"), (String -> FastString
fsLit "atanl"),
(String -> FastString
fsLit "atan2"), (String -> FastString
fsLit "atan2f"), (String -> FastString
fsLit "atan2l"),
(String -> FastString
fsLit "atanh"), (String -> FastString
fsLit "atanhf"), (String -> FastString
fsLit "atanhl"),
(String -> FastString
fsLit "cbrt"), (String -> FastString
fsLit "cbrtf"), (String -> FastString
fsLit "cbrtl"),
(String -> FastString
fsLit "ceil"), (String -> FastString
fsLit "ceilf"), (String -> FastString
fsLit "ceill"),
(String -> FastString
fsLit "copysign"), (String -> FastString
fsLit "copysignf"), (String -> FastString
fsLit "copysignl"),
(String -> FastString
fsLit "cos"), (String -> FastString
fsLit "cosf"), (String -> FastString
fsLit "cosl"),
(String -> FastString
fsLit "cosh"), (String -> FastString
fsLit "coshf"), (String -> FastString
fsLit "coshl"),
(String -> FastString
fsLit "erf"), (String -> FastString
fsLit "erff"), (String -> FastString
fsLit "erfl"),
(String -> FastString
fsLit "erfc"), (String -> FastString
fsLit "erfcf"), (String -> FastString
fsLit "erfcl"),
(String -> FastString
fsLit "exp"), (String -> FastString
fsLit "expf"), (String -> FastString
fsLit "expl"),
(String -> FastString
fsLit "exp2"), (String -> FastString
fsLit "exp2f"), (String -> FastString
fsLit "exp2l"),
(String -> FastString
fsLit "expm1"), (String -> FastString
fsLit "expm1f"), (String -> FastString
fsLit "expm1l"),
(String -> FastString
fsLit "fabs"), (String -> FastString
fsLit "fabsf"), (String -> FastString
fsLit "fabsl"),
(String -> FastString
fsLit "fdim"), (String -> FastString
fsLit "fdimf"), (String -> FastString
fsLit "fdiml"),
(String -> FastString
fsLit "floor"), (String -> FastString
fsLit "floorf"), (String -> FastString
fsLit "floorl"),
(String -> FastString
fsLit "fma"), (String -> FastString
fsLit "fmaf"), (String -> FastString
fsLit "fmal"),
(String -> FastString
fsLit "fmax"), (String -> FastString
fsLit "fmaxf"), (String -> FastString
fsLit "fmaxl"),
(String -> FastString
fsLit "fmin"), (String -> FastString
fsLit "fminf"), (String -> FastString
fsLit "fminl"),
(String -> FastString
fsLit "fmod"), (String -> FastString
fsLit "fmodf"), (String -> FastString
fsLit "fmodl"),
(String -> FastString
fsLit "frexp"), (String -> FastString
fsLit "frexpf"), (String -> FastString
fsLit "frexpl"),
(String -> FastString
fsLit "hypot"), (String -> FastString
fsLit "hypotf"), (String -> FastString
fsLit "hypotl"),
(String -> FastString
fsLit "ilogb"), (String -> FastString
fsLit "ilogbf"), (String -> FastString
fsLit "ilogbl"),
(String -> FastString
fsLit "ldexp"), (String -> FastString
fsLit "ldexpf"), (String -> FastString
fsLit "ldexpl"),
(String -> FastString
fsLit "lgamma"), (String -> FastString
fsLit "lgammaf"), (String -> FastString
fsLit "lgammal"),
(String -> FastString
fsLit "llrint"), (String -> FastString
fsLit "llrintf"), (String -> FastString
fsLit "llrintl"),
(String -> FastString
fsLit "llround"), (String -> FastString
fsLit "llroundf"), (String -> FastString
fsLit "llroundl"),
(String -> FastString
fsLit "log"), (String -> FastString
fsLit "logf"), (String -> FastString
fsLit "logl"),
(String -> FastString
fsLit "log10l"), (String -> FastString
fsLit "log10"), (String -> FastString
fsLit "log10f"),
(String -> FastString
fsLit "log1pl"), (String -> FastString
fsLit "log1p"), (String -> FastString
fsLit "log1pf"),
(String -> FastString
fsLit "log2"), (String -> FastString
fsLit "log2f"), (String -> FastString
fsLit "log2l"),
(String -> FastString
fsLit "logb"), (String -> FastString
fsLit "logbf"), (String -> FastString
fsLit "logbl"),
(String -> FastString
fsLit "lrint"), (String -> FastString
fsLit "lrintf"), (String -> FastString
fsLit "lrintl"),
(String -> FastString
fsLit "lround"), (String -> FastString
fsLit "lroundf"), (String -> FastString
fsLit "lroundl"),
(String -> FastString
fsLit "modf"), (String -> FastString
fsLit "modff"), (String -> FastString
fsLit "modfl"),
(String -> FastString
fsLit "nan"), (String -> FastString
fsLit "nanf"), (String -> FastString
fsLit "nanl"),
(String -> FastString
fsLit "nearbyint"), (String -> FastString
fsLit "nearbyintf"), (String -> FastString
fsLit "nearbyintl"),
(String -> FastString
fsLit "nextafter"), (String -> FastString
fsLit "nextafterf"), (String -> FastString
fsLit "nextafterl"),
(String -> FastString
fsLit "nexttoward"), (String -> FastString
fsLit "nexttowardf"), (String -> FastString
fsLit "nexttowardl"),
(String -> FastString
fsLit "pow"), (String -> FastString
fsLit "powf"), (String -> FastString
fsLit "powl"),
(String -> FastString
fsLit "remainder"), (String -> FastString
fsLit "remainderf"), (String -> FastString
fsLit "remainderl"),
(String -> FastString
fsLit "remquo"), (String -> FastString
fsLit "remquof"), (String -> FastString
fsLit "remquol"),
(String -> FastString
fsLit "rint"), (String -> FastString
fsLit "rintf"), (String -> FastString
fsLit "rintl"),
(String -> FastString
fsLit "round"), (String -> FastString
fsLit "roundf"), (String -> FastString
fsLit "roundl"),
(String -> FastString
fsLit "scalbln"), (String -> FastString
fsLit "scalblnf"), (String -> FastString
fsLit "scalblnl"),
(String -> FastString
fsLit "scalbn"), (String -> FastString
fsLit "scalbnf"), (String -> FastString
fsLit "scalbnl"),
(String -> FastString
fsLit "sin"), (String -> FastString
fsLit "sinf"), (String -> FastString
fsLit "sinl"),
(String -> FastString
fsLit "sinh"), (String -> FastString
fsLit "sinhf"), (String -> FastString
fsLit "sinhl"),
(String -> FastString
fsLit "sqrt"), (String -> FastString
fsLit "sqrtf"), (String -> FastString
fsLit "sqrtl"),
(String -> FastString
fsLit "tan"), (String -> FastString
fsLit "tanf"), (String -> FastString
fsLit "tanl"),
(String -> FastString
fsLit "tanh"), (String -> FastString
fsLit "tanhf"), (String -> FastString
fsLit "tanhl"),
(String -> FastString
fsLit "tgamma"), (String -> FastString
fsLit "tgammaf"), (String -> FastString
fsLit "tgammal"),
(String -> FastString
fsLit "trunc"), (String -> FastString
fsLit "truncf"), (String -> FastString
fsLit "truncl"),
(String -> FastString
fsLit "drem"), (String -> FastString
fsLit "dremf"), (String -> FastString
fsLit "dreml"),
(String -> FastString
fsLit "finite"), (String -> FastString
fsLit "finitef"), (String -> FastString
fsLit "finitel"),
(String -> FastString
fsLit "gamma"), (String -> FastString
fsLit "gammaf"), (String -> FastString
fsLit "gammal"),
(String -> FastString
fsLit "isinf"), (String -> FastString
fsLit "isinff"), (String -> FastString
fsLit "isinfl"),
(String -> FastString
fsLit "isnan"), (String -> FastString
fsLit "isnanf"), (String -> FastString
fsLit "isnanl"),
(String -> FastString
fsLit "j0"), (String -> FastString
fsLit "j0f"), (String -> FastString
fsLit "j0l"),
(String -> FastString
fsLit "j1"), (String -> FastString
fsLit "j1f"), (String -> FastString
fsLit "j1l"),
(String -> FastString
fsLit "jn"), (String -> FastString
fsLit "jnf"), (String -> FastString
fsLit "jnl"),
(String -> FastString
fsLit "lgamma_r"), (String -> FastString
fsLit "lgammaf_r"), (String -> FastString
fsLit "lgammal_r"),
(String -> FastString
fsLit "scalb"), (String -> FastString
fsLit "scalbf"), (String -> FastString
fsLit "scalbl"),
(String -> FastString
fsLit "significand"), (String -> FastString
fsLit "significandf"), (String -> FastString
fsLit "significandl"),
(String -> FastString
fsLit "y0"), (String -> FastString
fsLit "y0f"), (String -> FastString
fsLit "y0l"),
(String -> FastString
fsLit "y1"), (String -> FastString
fsLit "y1f"), (String -> FastString
fsLit "y1l"),
(String -> FastString
fsLit "yn"), (String -> FastString
fsLit "ynf"), (String -> FastString
fsLit "ynl"),
(String -> FastString
fsLit "nextup"), (String -> FastString
fsLit "nextupf"), (String -> FastString
fsLit "nextupl"),
(String -> FastString
fsLit "nextdown"), (String -> FastString
fsLit "nextdownf"), (String -> FastString
fsLit "nextdownl")
]
externallyVisibleCLabel :: CLabel -> Bool
externallyVisibleCLabel :: CLabel -> Bool
externallyVisibleCLabel (StringLitLabel _) = Bool
False
externallyVisibleCLabel (AsmTempLabel _) = Bool
False
externallyVisibleCLabel (AsmTempDerivedLabel _ _)= Bool
False
externallyVisibleCLabel (RtsLabel _) = Bool
True
externallyVisibleCLabel (LocalBlockLabel _) = Bool
False
externallyVisibleCLabel (CmmLabel _ _ _) = Bool
True
externallyVisibleCLabel (ForeignLabel{}) = Bool
True
externallyVisibleCLabel (IdLabel name :: Name
name _ info :: IdLabelInfo
info) = Name -> Bool
isExternalName Name
name Bool -> Bool -> Bool
&& IdLabelInfo -> Bool
externallyVisibleIdLabel IdLabelInfo
info
externallyVisibleCLabel (CC_Label _) = Bool
True
externallyVisibleCLabel (CCS_Label _) = Bool
True
externallyVisibleCLabel (DynamicLinkerLabel _ _) = Bool
False
externallyVisibleCLabel (HpcTicksLabel _) = Bool
True
externallyVisibleCLabel (LargeBitmapLabel _) = Bool
False
externallyVisibleCLabel (SRTLabel _) = Bool
False
externallyVisibleCLabel (PicBaseLabel {}) = String -> Bool
forall a. String -> a
panic "externallyVisibleCLabel PicBaseLabel"
externallyVisibleCLabel (DeadStripPreventer {}) = String -> Bool
forall a. String -> a
panic "externallyVisibleCLabel DeadStripPreventer"
externallyVisibleIdLabel :: IdLabelInfo -> Bool
externallyVisibleIdLabel :: IdLabelInfo -> Bool
externallyVisibleIdLabel LocalInfoTable = Bool
False
externallyVisibleIdLabel LocalEntry = Bool
False
externallyVisibleIdLabel BlockInfoTable = Bool
False
externallyVisibleIdLabel _ = Bool
True
data CLabelType
= CodeLabel
| DataLabel
| GcPtrLabel
isCFunctionLabel :: CLabel -> Bool
isCFunctionLabel :: CLabel -> Bool
isCFunctionLabel lbl :: CLabel
lbl = case CLabel -> CLabelType
labelType CLabel
lbl of
CodeLabel -> Bool
True
_other :: CLabelType
_other -> Bool
False
isGcPtrLabel :: CLabel -> Bool
isGcPtrLabel :: CLabel -> Bool
isGcPtrLabel lbl :: CLabel
lbl = case CLabel -> CLabelType
labelType CLabel
lbl of
GcPtrLabel -> Bool
True
_other :: CLabelType
_other -> Bool
False
labelType :: CLabel -> CLabelType
labelType :: CLabel -> CLabelType
labelType (IdLabel _ _ info :: IdLabelInfo
info) = IdLabelInfo -> CLabelType
idInfoLabelType IdLabelInfo
info
labelType (CmmLabel _ _ CmmData) = CLabelType
DataLabel
labelType (CmmLabel _ _ CmmClosure) = CLabelType
GcPtrLabel
labelType (CmmLabel _ _ CmmCode) = CLabelType
CodeLabel
labelType (CmmLabel _ _ CmmInfo) = CLabelType
DataLabel
labelType (CmmLabel _ _ CmmEntry) = CLabelType
CodeLabel
labelType (CmmLabel _ _ CmmPrimCall) = CLabelType
CodeLabel
labelType (CmmLabel _ _ CmmRetInfo) = CLabelType
DataLabel
labelType (CmmLabel _ _ CmmRet) = CLabelType
CodeLabel
labelType (RtsLabel (RtsSelectorInfoTable _ _)) = CLabelType
DataLabel
labelType (RtsLabel (RtsApInfoTable _ _)) = CLabelType
DataLabel
labelType (RtsLabel (RtsApFast _)) = CLabelType
CodeLabel
labelType (RtsLabel _) = CLabelType
DataLabel
labelType (LocalBlockLabel _) = CLabelType
CodeLabel
labelType (SRTLabel _) = CLabelType
DataLabel
labelType (ForeignLabel _ _ _ IsFunction) = CLabelType
CodeLabel
labelType (ForeignLabel _ _ _ IsData) = CLabelType
DataLabel
labelType (AsmTempLabel _) = String -> CLabelType
forall a. String -> a
panic "labelType(AsmTempLabel)"
labelType (AsmTempDerivedLabel _ _) = String -> CLabelType
forall a. String -> a
panic "labelType(AsmTempDerivedLabel)"
labelType (StringLitLabel _) = CLabelType
DataLabel
labelType (CC_Label _) = CLabelType
DataLabel
labelType (CCS_Label _) = CLabelType
DataLabel
labelType (DynamicLinkerLabel _ _) = CLabelType
DataLabel
labelType PicBaseLabel = CLabelType
DataLabel
labelType (DeadStripPreventer _) = CLabelType
DataLabel
labelType (HpcTicksLabel _) = CLabelType
DataLabel
labelType (LargeBitmapLabel _) = CLabelType
DataLabel
idInfoLabelType :: IdLabelInfo -> CLabelType
idInfoLabelType :: IdLabelInfo -> CLabelType
idInfoLabelType info :: IdLabelInfo
info =
case IdLabelInfo
info of
InfoTable -> CLabelType
DataLabel
LocalInfoTable -> CLabelType
DataLabel
BlockInfoTable -> CLabelType
DataLabel
Closure -> CLabelType
GcPtrLabel
ConInfoTable -> CLabelType
DataLabel
ClosureTable -> CLabelType
DataLabel
RednCounts -> CLabelType
DataLabel
Bytes -> CLabelType
DataLabel
_ -> CLabelType
CodeLabel
isLocalCLabel :: Module -> CLabel -> Bool
isLocalCLabel :: Module -> CLabel -> Bool
isLocalCLabel this_mod :: Module
this_mod lbl :: CLabel
lbl =
case CLabel
lbl of
IdLabel name :: Name
name _ _
| Name -> Bool
isInternalName Name
name -> Bool
True
| Bool
otherwise -> HasDebugCallStack => Name -> Module
Name -> Module
nameModule Name
name Module -> Module -> Bool
forall a. Eq a => a -> a -> Bool
== Module
this_mod
LocalBlockLabel _ -> Bool
True
_ -> Bool
False
labelDynamic :: DynFlags -> Module -> CLabel -> Bool
labelDynamic :: DynFlags -> Module -> CLabel -> Bool
labelDynamic dflags :: DynFlags
dflags this_mod :: Module
this_mod lbl :: CLabel
lbl =
case CLabel
lbl of
RtsLabel _ ->
Bool
externalDynamicRefs Bool -> Bool -> Bool
&& (UnitId
this_pkg UnitId -> UnitId -> Bool
forall a. Eq a => a -> a -> Bool
/= UnitId
rtsUnitId)
IdLabel n :: Name
n _ _ ->
DynFlags -> Module -> Name -> Bool
isDllName DynFlags
dflags Module
this_mod Name
n
CmmLabel pkg :: UnitId
pkg _ _
| OS
os OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSMinGW32 ->
Bool
externalDynamicRefs Bool -> Bool -> Bool
&& (UnitId
this_pkg UnitId -> UnitId -> Bool
forall a. Eq a => a -> a -> Bool
/= UnitId
pkg)
| Bool
otherwise ->
GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ExternalDynamicRefs DynFlags
dflags
LocalBlockLabel _ -> Bool
False
ForeignLabel _ _ source :: ForeignLabelSource
source _ ->
if OS
os OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSMinGW32
then case ForeignLabelSource
source of
ForeignLabelInExternalPackage -> Bool
True
ForeignLabelInThisPackage -> Bool
False
ForeignLabelInPackage pkgId :: UnitId
pkgId ->
Bool
externalDynamicRefs Bool -> Bool -> Bool
&& (UnitId
this_pkg UnitId -> UnitId -> Bool
forall a. Eq a => a -> a -> Bool
/= UnitId
pkgId)
else
Bool
True
CC_Label cc :: CostCentre
cc ->
Bool
externalDynamicRefs Bool -> Bool -> Bool
&& Bool -> Bool
not (CostCentre -> Module -> Bool
ccFromThisModule CostCentre
cc Module
this_mod)
CCS_Label _ -> Bool
False
HpcTicksLabel m :: Module
m ->
Bool
externalDynamicRefs Bool -> Bool -> Bool
&& Module
this_mod Module -> Module -> Bool
forall a. Eq a => a -> a -> Bool
/= Module
m
_ -> Bool
False
where
externalDynamicRefs :: Bool
externalDynamicRefs = GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_ExternalDynamicRefs DynFlags
dflags
os :: OS
os = Platform -> OS
platformOS (DynFlags -> Platform
targetPlatform DynFlags
dflags)
this_pkg :: UnitId
this_pkg = Module -> UnitId
moduleUnitId Module
this_mod
instance Outputable CLabel where
ppr :: CLabel -> SDoc
ppr c :: CLabel
c = (Platform -> SDoc) -> SDoc
sdocWithPlatform ((Platform -> SDoc) -> SDoc) -> (Platform -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \platform :: Platform
platform -> Platform -> CLabel -> SDoc
pprCLabel Platform
platform CLabel
c
pprCLabel :: Platform -> CLabel -> SDoc
pprCLabel :: Platform -> CLabel -> SDoc
pprCLabel _ (LocalBlockLabel u :: Unique
u)
= SDoc
tempLabelPrefixOrUnderscore SDoc -> SDoc -> SDoc
<> Unique -> SDoc
pprUniqueAlways Unique
u
pprCLabel platform :: Platform
platform (AsmTempLabel u :: Unique
u)
| Bool -> Bool
not (Platform -> Bool
platformUnregisterised Platform
platform)
= SDoc
tempLabelPrefixOrUnderscore SDoc -> SDoc -> SDoc
<> Unique -> SDoc
pprUniqueAlways Unique
u
pprCLabel platform :: Platform
platform (AsmTempDerivedLabel l :: CLabel
l suf :: FastString
suf)
| String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
= PtrString -> SDoc
ptext (Platform -> PtrString
asmTempLabelPrefix Platform
platform)
SDoc -> SDoc -> SDoc
<> case CLabel
l of AsmTempLabel u :: Unique
u -> Unique -> SDoc
pprUniqueAlways Unique
u
LocalBlockLabel u :: Unique
u -> Unique -> SDoc
pprUniqueAlways Unique
u
_other :: CLabel
_other -> Platform -> CLabel -> SDoc
pprCLabel Platform
platform CLabel
l
SDoc -> SDoc -> SDoc
<> FastString -> SDoc
ftext FastString
suf
pprCLabel platform :: Platform
platform (DynamicLinkerLabel info :: DynamicLinkerLabelInfo
info lbl :: CLabel
lbl)
| String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
= Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel Platform
platform DynamicLinkerLabelInfo
info CLabel
lbl
pprCLabel _ PicBaseLabel
| String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
= String -> SDoc
text "1b"
pprCLabel platform :: Platform
platform (DeadStripPreventer lbl :: CLabel
lbl)
| String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
=
SDoc -> SDoc
maybe_underscore (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "dsp_"
SDoc -> SDoc -> SDoc
<> Platform -> CLabel -> SDoc
pprCLabel Platform
platform CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_dsp"
pprCLabel _ (StringLitLabel u :: Unique
u)
| String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES"
= Unique -> SDoc
pprUniqueAlways Unique
u SDoc -> SDoc -> SDoc
<> PtrString -> SDoc
ptext (String -> PtrString
sLit "_str")
pprCLabel platform :: Platform
platform lbl :: CLabel
lbl
= (PprStyle -> SDoc) -> SDoc
getPprStyle ((PprStyle -> SDoc) -> SDoc) -> (PprStyle -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \ sty :: PprStyle
sty ->
if String
cGhcWithNativeCodeGen String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES" Bool -> Bool -> Bool
&& PprStyle -> Bool
asmStyle PprStyle
sty
then SDoc -> SDoc
maybe_underscore (Platform -> CLabel -> SDoc
pprAsmCLbl Platform
platform CLabel
lbl)
else CLabel -> SDoc
pprCLbl CLabel
lbl
maybe_underscore :: SDoc -> SDoc
maybe_underscore :: SDoc -> SDoc
maybe_underscore doc :: SDoc
doc
| Bool
underscorePrefix = SDoc
pp_cSEP SDoc -> SDoc -> SDoc
<> SDoc
doc
| Bool
otherwise = SDoc
doc
pprAsmCLbl :: Platform -> CLabel -> SDoc
pprAsmCLbl :: Platform -> CLabel -> SDoc
pprAsmCLbl platform :: Platform
platform (ForeignLabel fs :: FastString
fs (Just sz :: Int
sz) _ _)
| Platform -> OS
platformOS Platform
platform OS -> OS -> Bool
forall a. Eq a => a -> a -> Bool
== OS
OSMinGW32
= FastString -> SDoc
ftext FastString
fs SDoc -> SDoc -> SDoc
<> Char -> SDoc
char '@' SDoc -> SDoc -> SDoc
<> Int -> SDoc
int Int
sz
pprAsmCLbl _ lbl :: CLabel
lbl
= CLabel -> SDoc
pprCLbl CLabel
lbl
pprCLbl :: CLabel -> SDoc
pprCLbl :: CLabel -> SDoc
pprCLbl (StringLitLabel u :: Unique
u)
= Unique -> SDoc
pprUniqueAlways Unique
u SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_str"
pprCLbl (SRTLabel u :: Unique
u)
= SDoc
tempLabelPrefixOrUnderscore SDoc -> SDoc -> SDoc
<> Unique -> SDoc
pprUniqueAlways Unique
u SDoc -> SDoc -> SDoc
<> SDoc
pp_cSEP SDoc -> SDoc -> SDoc
<> String -> SDoc
text "srt"
pprCLbl (LargeBitmapLabel u :: Unique
u) =
SDoc
tempLabelPrefixOrUnderscore
SDoc -> SDoc -> SDoc
<> Char -> SDoc
char 'b' SDoc -> SDoc -> SDoc
<> Unique -> SDoc
pprUniqueAlways Unique
u SDoc -> SDoc -> SDoc
<> SDoc
pp_cSEP SDoc -> SDoc -> SDoc
<> String -> SDoc
text "btm"
pprCLbl (CmmLabel _ str :: FastString
str CmmCode) = FastString -> SDoc
ftext FastString
str
pprCLbl (CmmLabel _ str :: FastString
str CmmData) = FastString -> SDoc
ftext FastString
str
pprCLbl (CmmLabel _ str :: FastString
str CmmPrimCall) = FastString -> SDoc
ftext FastString
str
pprCLbl (LocalBlockLabel u :: Unique
u) =
SDoc
tempLabelPrefixOrUnderscore SDoc -> SDoc -> SDoc
<> String -> SDoc
text "blk_" SDoc -> SDoc -> SDoc
<> Unique -> SDoc
pprUniqueAlways Unique
u
pprCLbl (RtsLabel (RtsApFast str :: FastString
str)) = FastString -> SDoc
ftext FastString
str SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_fast"
pprCLbl (RtsLabel (RtsSelectorInfoTable upd_reqd :: Bool
upd_reqd offset :: Int
offset))
= (DynFlags -> SDoc) -> SDoc
sdocWithDynFlags ((DynFlags -> SDoc) -> SDoc) -> (DynFlags -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \dflags :: DynFlags
dflags ->
ASSERT(offset >= 0 && offset <= mAX_SPEC_SELECTEE_SIZE dflags)
[SDoc] -> SDoc
hcat [String -> SDoc
text "stg_sel_", String -> SDoc
text (Int -> String
forall a. Show a => a -> String
show Int
offset),
PtrString -> SDoc
ptext (if Bool
upd_reqd
then (String -> PtrString
sLit "_upd_info")
else (String -> PtrString
sLit "_noupd_info"))
]
pprCLbl (RtsLabel (RtsSelectorEntry upd_reqd :: Bool
upd_reqd offset :: Int
offset))
= (DynFlags -> SDoc) -> SDoc
sdocWithDynFlags ((DynFlags -> SDoc) -> SDoc) -> (DynFlags -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \dflags :: DynFlags
dflags ->
ASSERT(offset >= 0 && offset <= mAX_SPEC_SELECTEE_SIZE dflags)
[SDoc] -> SDoc
hcat [String -> SDoc
text "stg_sel_", String -> SDoc
text (Int -> String
forall a. Show a => a -> String
show Int
offset),
PtrString -> SDoc
ptext (if Bool
upd_reqd
then (String -> PtrString
sLit "_upd_entry")
else (String -> PtrString
sLit "_noupd_entry"))
]
pprCLbl (RtsLabel (RtsApInfoTable upd_reqd :: Bool
upd_reqd arity :: Int
arity))
= (DynFlags -> SDoc) -> SDoc
sdocWithDynFlags ((DynFlags -> SDoc) -> SDoc) -> (DynFlags -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \dflags :: DynFlags
dflags ->
ASSERT(arity > 0 && arity <= mAX_SPEC_AP_SIZE dflags)
[SDoc] -> SDoc
hcat [String -> SDoc
text "stg_ap_", String -> SDoc
text (Int -> String
forall a. Show a => a -> String
show Int
arity),
PtrString -> SDoc
ptext (if Bool
upd_reqd
then (String -> PtrString
sLit "_upd_info")
else (String -> PtrString
sLit "_noupd_info"))
]
pprCLbl (RtsLabel (RtsApEntry upd_reqd :: Bool
upd_reqd arity :: Int
arity))
= (DynFlags -> SDoc) -> SDoc
sdocWithDynFlags ((DynFlags -> SDoc) -> SDoc) -> (DynFlags -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \dflags :: DynFlags
dflags ->
ASSERT(arity > 0 && arity <= mAX_SPEC_AP_SIZE dflags)
[SDoc] -> SDoc
hcat [String -> SDoc
text "stg_ap_", String -> SDoc
text (Int -> String
forall a. Show a => a -> String
show Int
arity),
PtrString -> SDoc
ptext (if Bool
upd_reqd
then (String -> PtrString
sLit "_upd_entry")
else (String -> PtrString
sLit "_noupd_entry"))
]
pprCLbl (CmmLabel _ fs :: FastString
fs CmmInfo)
= FastString -> SDoc
ftext FastString
fs SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_info"
pprCLbl (CmmLabel _ fs :: FastString
fs CmmEntry)
= FastString -> SDoc
ftext FastString
fs SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_entry"
pprCLbl (CmmLabel _ fs :: FastString
fs CmmRetInfo)
= FastString -> SDoc
ftext FastString
fs SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_info"
pprCLbl (CmmLabel _ fs :: FastString
fs CmmRet)
= FastString -> SDoc
ftext FastString
fs SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_ret"
pprCLbl (CmmLabel _ fs :: FastString
fs CmmClosure)
= FastString -> SDoc
ftext FastString
fs SDoc -> SDoc -> SDoc
<> String -> SDoc
text "_closure"
pprCLbl (RtsLabel (RtsPrimOp primop :: PrimOp
primop))
= String -> SDoc
text "stg_" SDoc -> SDoc -> SDoc
<> PrimOp -> SDoc
forall a. Outputable a => a -> SDoc
ppr PrimOp
primop
pprCLbl (RtsLabel (RtsSlowFastTickyCtr pat :: String
pat))
= String -> SDoc
text "SLOW_CALL_fast_" SDoc -> SDoc -> SDoc
<> String -> SDoc
text String
pat SDoc -> SDoc -> SDoc
<> PtrString -> SDoc
ptext (String -> PtrString
sLit "_ctr")
pprCLbl (ForeignLabel str :: FastString
str _ _ _)
= FastString -> SDoc
ftext FastString
str
pprCLbl (IdLabel name :: Name
name _cafs :: CafInfo
_cafs flavor :: IdLabelInfo
flavor) =
Name -> SDoc
internalNamePrefix Name
name SDoc -> SDoc -> SDoc
<> Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr Name
name SDoc -> SDoc -> SDoc
<> IdLabelInfo -> SDoc
ppIdFlavor IdLabelInfo
flavor
pprCLbl (CC_Label cc :: CostCentre
cc) = CostCentre -> SDoc
forall a. Outputable a => a -> SDoc
ppr CostCentre
cc
pprCLbl (CCS_Label ccs :: CostCentreStack
ccs) = CostCentreStack -> SDoc
forall a. Outputable a => a -> SDoc
ppr CostCentreStack
ccs
pprCLbl (HpcTicksLabel mod :: Module
mod)
= String -> SDoc
text "_hpc_tickboxes_" SDoc -> SDoc -> SDoc
<> Module -> SDoc
forall a. Outputable a => a -> SDoc
ppr Module
mod SDoc -> SDoc -> SDoc
<> PtrString -> SDoc
ptext (String -> PtrString
sLit "_hpc")
pprCLbl (AsmTempLabel {}) = String -> SDoc
forall a. String -> a
panic "pprCLbl AsmTempLabel"
pprCLbl (AsmTempDerivedLabel {})= String -> SDoc
forall a. String -> a
panic "pprCLbl AsmTempDerivedLabel"
pprCLbl (DynamicLinkerLabel {}) = String -> SDoc
forall a. String -> a
panic "pprCLbl DynamicLinkerLabel"
pprCLbl (PicBaseLabel {}) = String -> SDoc
forall a. String -> a
panic "pprCLbl PicBaseLabel"
pprCLbl (DeadStripPreventer {}) = String -> SDoc
forall a. String -> a
panic "pprCLbl DeadStripPreventer"
ppIdFlavor :: IdLabelInfo -> SDoc
ppIdFlavor :: IdLabelInfo -> SDoc
ppIdFlavor x :: IdLabelInfo
x = SDoc
pp_cSEP SDoc -> SDoc -> SDoc
<> String -> SDoc
text
(case IdLabelInfo
x of
Closure -> "closure"
InfoTable -> "info"
LocalInfoTable -> "info"
Entry -> "entry"
LocalEntry -> "entry"
Slow -> "slow"
RednCounts -> "ct"
ConEntry -> "con_entry"
ConInfoTable -> "con_info"
ClosureTable -> "closure_tbl"
Bytes -> "bytes"
BlockInfoTable -> "info"
)
pp_cSEP :: SDoc
pp_cSEP :: SDoc
pp_cSEP = Char -> SDoc
char '_'
instance Outputable ForeignLabelSource where
ppr :: ForeignLabelSource -> SDoc
ppr fs :: ForeignLabelSource
fs
= case ForeignLabelSource
fs of
ForeignLabelInPackage pkgId :: UnitId
pkgId -> SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "package: " SDoc -> SDoc -> SDoc
<> UnitId -> SDoc
forall a. Outputable a => a -> SDoc
ppr UnitId
pkgId
ForeignLabelInThisPackage -> SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "this package"
ForeignLabelInExternalPackage -> SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ String -> SDoc
text "external package"
internalNamePrefix :: Name -> SDoc
internalNamePrefix :: Name -> SDoc
internalNamePrefix name :: Name
name = (PprStyle -> SDoc) -> SDoc
getPprStyle ((PprStyle -> SDoc) -> SDoc) -> (PprStyle -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \ sty :: PprStyle
sty ->
if PprStyle -> Bool
asmStyle PprStyle
sty Bool -> Bool -> Bool
&& Bool
isRandomGenerated then
(Platform -> SDoc) -> SDoc
sdocWithPlatform ((Platform -> SDoc) -> SDoc) -> (Platform -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \platform :: Platform
platform ->
PtrString -> SDoc
ptext (Platform -> PtrString
asmTempLabelPrefix Platform
platform)
else
SDoc
empty
where
isRandomGenerated :: Bool
isRandomGenerated = Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ Name -> Bool
isExternalName Name
name
tempLabelPrefixOrUnderscore :: SDoc
tempLabelPrefixOrUnderscore :: SDoc
tempLabelPrefixOrUnderscore = (Platform -> SDoc) -> SDoc
sdocWithPlatform ((Platform -> SDoc) -> SDoc) -> (Platform -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \platform :: Platform
platform ->
(PprStyle -> SDoc) -> SDoc
getPprStyle ((PprStyle -> SDoc) -> SDoc) -> (PprStyle -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \ sty :: PprStyle
sty ->
if PprStyle -> Bool
asmStyle PprStyle
sty then
PtrString -> SDoc
ptext (Platform -> PtrString
asmTempLabelPrefix Platform
platform)
else
Char -> SDoc
char '_'
underscorePrefix :: Bool
underscorePrefix :: Bool
underscorePrefix = (String
cLeadingUnderscore String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== "YES")
asmTempLabelPrefix :: Platform -> PtrString
asmTempLabelPrefix :: Platform -> PtrString
asmTempLabelPrefix platform :: Platform
platform = case Platform -> OS
platformOS Platform
platform of
OSDarwin -> String -> PtrString
sLit "L"
OSAIX -> String -> PtrString
sLit "__L"
_ -> String -> PtrString
sLit ".L"
pprDynamicLinkerAsmLabel :: Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel :: Platform -> DynamicLinkerLabelInfo -> CLabel -> SDoc
pprDynamicLinkerAsmLabel platform :: Platform
platform dllInfo :: DynamicLinkerLabelInfo
dllInfo lbl :: CLabel
lbl =
case Platform -> OS
platformOS Platform
platform of
OSDarwin
| Platform -> Arch
platformArch Platform
platform Arch -> Arch -> Bool
forall a. Eq a => a -> a -> Bool
== Arch
ArchX86_64 ->
case DynamicLinkerLabelInfo
dllInfo of
CodeStub -> Char -> SDoc
char 'L' SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "$stub"
SymbolPtr -> Char -> SDoc
char 'L' SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "$non_lazy_ptr"
GotSymbolPtr -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@GOTPCREL"
GotSymbolOffset -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
| Bool
otherwise ->
case DynamicLinkerLabelInfo
dllInfo of
CodeStub -> Char -> SDoc
char 'L' SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "$stub"
SymbolPtr -> Char -> SDoc
char 'L' SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "$non_lazy_ptr"
_ -> String -> SDoc
forall a. String -> a
panic "pprDynamicLinkerAsmLabel"
OSAIX ->
case DynamicLinkerLabelInfo
dllInfo of
SymbolPtr -> String -> SDoc
text "LC.." SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
_ -> String -> SDoc
forall a. String -> a
panic "pprDynamicLinkerAsmLabel"
_ | OS -> Bool
osElfTarget (Platform -> OS
platformOS Platform
platform) -> SDoc
elfLabel
OSMinGW32 ->
case DynamicLinkerLabelInfo
dllInfo of
SymbolPtr -> String -> SDoc
text "__imp_" SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
_ -> String -> SDoc
forall a. String -> a
panic "pprDynamicLinkerAsmLabel"
_ -> String -> SDoc
forall a. String -> a
panic "pprDynamicLinkerAsmLabel"
where
elfLabel :: SDoc
elfLabel
| Platform -> Arch
platformArch Platform
platform Arch -> Arch -> Bool
forall a. Eq a => a -> a -> Bool
== Arch
ArchPPC
= case DynamicLinkerLabelInfo
dllInfo of
CodeStub ->
CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "+32768@plt"
SymbolPtr -> String -> SDoc
text ".LC_" SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
_ -> String -> SDoc
forall a. String -> a
panic "pprDynamicLinkerAsmLabel"
| Platform -> Arch
platformArch Platform
platform Arch -> Arch -> Bool
forall a. Eq a => a -> a -> Bool
== Arch
ArchX86_64
= case DynamicLinkerLabelInfo
dllInfo of
CodeStub -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@plt"
GotSymbolPtr -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@gotpcrel"
GotSymbolOffset -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
SymbolPtr -> String -> SDoc
text ".LC_" SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
| Platform -> Arch
platformArch Platform
platform Arch -> Arch -> Bool
forall a. Eq a => a -> a -> Bool
== PPC_64ABI -> Arch
ArchPPC_64 PPC_64ABI
ELF_V1
Bool -> Bool -> Bool
|| Platform -> Arch
platformArch Platform
platform Arch -> Arch -> Bool
forall a. Eq a => a -> a -> Bool
== PPC_64ABI -> Arch
ArchPPC_64 PPC_64ABI
ELF_V2
= case DynamicLinkerLabelInfo
dllInfo of
GotSymbolPtr -> String -> SDoc
text ".LC_" SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@toc"
GotSymbolOffset -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
SymbolPtr -> String -> SDoc
text ".LC_" SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
_ -> String -> SDoc
forall a. String -> a
panic "pprDynamicLinkerAsmLabel"
| Bool
otherwise
= case DynamicLinkerLabelInfo
dllInfo of
CodeStub -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@plt"
SymbolPtr -> String -> SDoc
text ".LC_" SDoc -> SDoc -> SDoc
<> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl
GotSymbolPtr -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@got"
GotSymbolOffset -> CLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr CLabel
lbl SDoc -> SDoc -> SDoc
<> String -> SDoc
text "@gotoff"