Commit 1aba27a3 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

CLabels: Remove CaseLabel

Reviewers: simonmar

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4188
parent ea261622
...@@ -184,10 +184,6 @@ data CLabel ...@@ -184,10 +184,6 @@ data CLabel
FunctionOrData FunctionOrData
-- | A family of labels related to a particular case expression. -- | A family of labels related to a particular case expression.
| CaseLabel
{-# UNPACK #-} !Unique -- Unique says which case expression
CaseLabelInfo
-- | Local temporary label used for native (or LLVM) code generation -- | Local temporary label used for native (or LLVM) code generation
| AsmTempLabel | AsmTempLabel
{-# UNPACK #-} !Unique {-# UNPACK #-} !Unique
...@@ -255,9 +251,6 @@ instance Ord CLabel where ...@@ -255,9 +251,6 @@ instance Ord CLabel where
compare b1 b2 `thenCmp` compare b1 b2 `thenCmp`
compare c1 c2 `thenCmp` compare c1 c2 `thenCmp`
compare d1 d2 compare d1 d2
compare (CaseLabel u1 a1) (CaseLabel u2 a2) =
nonDetCmpUnique u1 u2 `thenCmp`
compare a1 a2
compare (AsmTempLabel u1) (AsmTempLabel u2) = nonDetCmpUnique u1 u2 compare (AsmTempLabel u1) (AsmTempLabel u2) = nonDetCmpUnique u1 u2
compare (AsmTempDerivedLabel a1 b1) (AsmTempDerivedLabel a2 b2) = compare (AsmTempDerivedLabel a1 b1) (AsmTempDerivedLabel a2 b2) =
compare a1 a2 `thenCmp` compare a1 a2 `thenCmp`
...@@ -290,8 +283,6 @@ instance Ord CLabel where ...@@ -290,8 +283,6 @@ instance Ord CLabel where
compare _ RtsLabel{} = GT compare _ RtsLabel{} = GT
compare ForeignLabel{} _ = LT compare ForeignLabel{} _ = LT
compare _ ForeignLabel{} = GT compare _ ForeignLabel{} = GT
compare CaseLabel{} _ = LT
compare _ CaseLabel{} = GT
compare AsmTempLabel{} _ = LT compare AsmTempLabel{} _ = LT
compare _ AsmTempLabel{} = GT compare _ AsmTempLabel{} = GT
compare AsmTempDerivedLabel{} _ = LT compare AsmTempDerivedLabel{} _ = LT
...@@ -387,14 +378,6 @@ data IdLabelInfo ...@@ -387,14 +378,6 @@ data IdLabelInfo
deriving (Eq, Ord) deriving (Eq, Ord)
data CaseLabelInfo
= CaseReturnPt
| CaseReturnInfo
| CaseAlt ConTag
| CaseDefault
deriving (Eq, Ord)
data RtsLabelInfo data RtsLabelInfo
= RtsSelectorInfoTable Bool{-updatable-} Int{-offset-} -- ^ Selector thunks = RtsSelectorInfoTable Bool{-updatable-} Int{-offset-} -- ^ Selector thunks
| RtsSelectorEntry Bool{-updatable-} Int{-offset-} | RtsSelectorEntry Bool{-updatable-} Int{-offset-}
...@@ -672,7 +655,6 @@ toEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry ...@@ -672,7 +655,6 @@ toEntryLbl (IdLabel n c ConInfoTable) = IdLabel n c ConEntry
toEntryLbl (IdLabel n _ BlockInfoTable) = mkAsmTempLabel (nameUnique n) toEntryLbl (IdLabel n _ BlockInfoTable) = mkAsmTempLabel (nameUnique n)
-- See Note [Proc-point local block entry-point]. -- See Note [Proc-point local block entry-point].
toEntryLbl (IdLabel n c _) = IdLabel n c Entry toEntryLbl (IdLabel n c _) = IdLabel n c Entry
toEntryLbl (CaseLabel n CaseReturnInfo) = CaseLabel n CaseReturnPt
toEntryLbl (CmmLabel m str CmmInfo) = CmmLabel m str CmmEntry toEntryLbl (CmmLabel m str CmmInfo) = CmmLabel m str CmmEntry
toEntryLbl (CmmLabel m str CmmRetInfo) = CmmLabel m str CmmRet toEntryLbl (CmmLabel m str CmmRetInfo) = CmmLabel m str CmmRet
toEntryLbl l = pprPanic "toEntryLbl" (ppr l) toEntryLbl l = pprPanic "toEntryLbl" (ppr l)
...@@ -681,7 +663,6 @@ toInfoLbl :: CLabel -> CLabel ...@@ -681,7 +663,6 @@ toInfoLbl :: CLabel -> CLabel
toInfoLbl (IdLabel n c LocalEntry) = IdLabel n c LocalInfoTable toInfoLbl (IdLabel n c LocalEntry) = IdLabel n c LocalInfoTable
toInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable toInfoLbl (IdLabel n c ConEntry) = IdLabel n c ConInfoTable
toInfoLbl (IdLabel n c _) = IdLabel n c InfoTable toInfoLbl (IdLabel n c _) = IdLabel n c InfoTable
toInfoLbl (CaseLabel n CaseReturnPt) = CaseLabel n CaseReturnInfo
toInfoLbl (CmmLabel m str CmmEntry) = CmmLabel m str CmmInfo toInfoLbl (CmmLabel m str CmmEntry) = CmmLabel m str CmmInfo
toInfoLbl (CmmLabel m str CmmRet) = CmmLabel m str CmmRetInfo toInfoLbl (CmmLabel m str CmmRet) = CmmLabel m str CmmRetInfo
toInfoLbl l = pprPanic "CLabel.toInfoLbl" (ppr l) toInfoLbl l = pprPanic "CLabel.toInfoLbl" (ppr l)
...@@ -729,7 +710,6 @@ needsCDecl (SRTLabel _) = True ...@@ -729,7 +710,6 @@ needsCDecl (SRTLabel _) = True
needsCDecl (LargeSRTLabel _) = False needsCDecl (LargeSRTLabel _) = False
needsCDecl (LargeBitmapLabel _) = False needsCDecl (LargeBitmapLabel _) = False
needsCDecl (IdLabel _ _ _) = True needsCDecl (IdLabel _ _ _) = True
needsCDecl (CaseLabel _ _) = True
needsCDecl (StringLitLabel _) = False needsCDecl (StringLitLabel _) = False
needsCDecl (AsmTempLabel _) = False needsCDecl (AsmTempLabel _) = False
...@@ -859,7 +839,6 @@ math_funs = mkUniqSet [ ...@@ -859,7 +839,6 @@ math_funs = mkUniqSet [
-- externally visible if it has to be declared as exported -- externally visible if it has to be declared as exported
-- in the .o file's symbol table; that is, made non-static. -- in the .o file's symbol table; that is, made non-static.
externallyVisibleCLabel :: CLabel -> Bool -- not C "static" externallyVisibleCLabel :: CLabel -> Bool -- not C "static"
externallyVisibleCLabel (CaseLabel _ _) = False
externallyVisibleCLabel (StringLitLabel _) = False externallyVisibleCLabel (StringLitLabel _) = False
externallyVisibleCLabel (AsmTempLabel _) = False externallyVisibleCLabel (AsmTempLabel _) = False
externallyVisibleCLabel (AsmTempDerivedLabel _ _)= False externallyVisibleCLabel (AsmTempDerivedLabel _ _)= False
...@@ -919,8 +898,6 @@ labelType (CmmLabel _ _ CmmRet) = CodeLabel ...@@ -919,8 +898,6 @@ labelType (CmmLabel _ _ CmmRet) = CodeLabel
labelType (RtsLabel (RtsSelectorInfoTable _ _)) = DataLabel labelType (RtsLabel (RtsSelectorInfoTable _ _)) = DataLabel
labelType (RtsLabel (RtsApInfoTable _ _)) = DataLabel labelType (RtsLabel (RtsApInfoTable _ _)) = DataLabel
labelType (RtsLabel (RtsApFast _)) = CodeLabel labelType (RtsLabel (RtsApFast _)) = CodeLabel
labelType (CaseLabel _ CaseReturnInfo) = DataLabel
labelType (CaseLabel _ _) = CodeLabel
labelType (SRTLabel _) = DataLabel labelType (SRTLabel _) = DataLabel
labelType (LargeSRTLabel _) = DataLabel labelType (LargeSRTLabel _) = DataLabel
labelType (LargeBitmapLabel _) = DataLabel labelType (LargeBitmapLabel _) = DataLabel
...@@ -1136,15 +1113,6 @@ pprCLbl :: CLabel -> SDoc ...@@ -1136,15 +1113,6 @@ pprCLbl :: CLabel -> SDoc
pprCLbl (StringLitLabel u) pprCLbl (StringLitLabel u)
= pprUniqueAlways u <> text "_str" = pprUniqueAlways u <> text "_str"
pprCLbl (CaseLabel u CaseReturnPt)
= hcat [pprUniqueAlways u, text "_ret"]
pprCLbl (CaseLabel u CaseReturnInfo)
= hcat [pprUniqueAlways u, text "_info"]
pprCLbl (CaseLabel u (CaseAlt tag))
= hcat [pprUniqueAlways u, pp_cSEP, int tag, text "_alt"]
pprCLbl (CaseLabel u CaseDefault)
= hcat [pprUniqueAlways u, text "_dflt"]
pprCLbl (SRTLabel u) pprCLbl (SRTLabel u)
= pprUniqueAlways u <> pp_cSEP <> text "srt" = pprUniqueAlways u <> pp_cSEP <> text "srt"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment