summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/SPARC
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-09-19 10:58:36 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-19 13:37:46 -0400
commit8b007abbeb3045900a11529d907a835080129176 (patch)
tree811084db4cf156ff51cf8661631676d6fb0ff326 /compiler/nativeGen/SPARC
parent6252292d4f4061f6e55c7f92a399160147c4ca74 (diff)
downloadhaskell-8b007abbeb3045900a11529d907a835080129176.tar.gz
nativeGen: Consistently use blockLbl to generate CLabels from BlockIds
This fixes #14221, where the NCG and the DWARF code were apparently giving two different names to the same block. Test Plan: Validate with DWARF support enabled. Reviewers: simonmar, austin Subscribers: rwbarton, thomie GHC Trac Issues: #14221 Differential Revision: https://phabricator.haskell.org/D3977
Diffstat (limited to 'compiler/nativeGen/SPARC')
-rw-r--r--compiler/nativeGen/SPARC/CodeGen.hs3
-rw-r--r--compiler/nativeGen/SPARC/Ppr.hs9
-rw-r--r--compiler/nativeGen/SPARC/ShortcutJump.hs4
3 files changed, 7 insertions, 9 deletions
diff --git a/compiler/nativeGen/SPARC/CodeGen.hs b/compiler/nativeGen/SPARC/CodeGen.hs
index 72e25b945f..902a5aea43 100644
--- a/compiler/nativeGen/SPARC/CodeGen.hs
+++ b/compiler/nativeGen/SPARC/CodeGen.hs
@@ -58,7 +58,6 @@ import FastString
import OrdList
import Outputable
import Platform
-import Unique
import Control.Monad ( mapAndUnzipM )
@@ -185,7 +184,7 @@ temporary, then do the other computation, and then use the temporary:
jumpTableEntry :: DynFlags -> Maybe BlockId -> CmmStatic
jumpTableEntry dflags Nothing = CmmStaticLit (CmmInt 0 (wordWidth dflags))
jumpTableEntry _ (Just blockid) = CmmStaticLit (CmmLabel blockLabel)
- where blockLabel = mkAsmTempLabel (getUnique blockid)
+ where blockLabel = blockLbl blockid
diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs
index 054a0dccdb..1e4d5c535d 100644
--- a/compiler/nativeGen/SPARC/Ppr.hs
+++ b/compiler/nativeGen/SPARC/Ppr.hs
@@ -38,11 +38,12 @@ import PprBase
import Cmm hiding (topInfoTable)
import PprCmm()
+import BlockId
import CLabel
import Hoopl.Label
import Hoopl.Collections
-import Unique ( Uniquable(..), pprUniqueAlways )
+import Unique ( pprUniqueAlways )
import Outputable
import Platform
import FastString
@@ -91,7 +92,7 @@ dspSection = Section Text $
pprBasicBlock :: LabelMap CmmStatics -> NatBasicBlock Instr -> SDoc
pprBasicBlock info_env (BasicBlock blockid instrs)
= maybe_infotable $$
- pprLabel (mkAsmTempLabel (getUnique blockid)) $$
+ pprLabel (blockLbl blockid) $$
vcat (map pprInstr instrs)
where
maybe_infotable = case mapLookup blockid info_env of
@@ -541,7 +542,7 @@ pprInstr (BI cond b blockid)
text "\tb", pprCond cond,
if b then pp_comma_a else empty,
char '\t',
- ppr (mkAsmTempLabel (getUnique blockid))
+ ppr (blockLbl blockid)
]
pprInstr (BF cond b blockid)
@@ -549,7 +550,7 @@ pprInstr (BF cond b blockid)
text "\tfb", pprCond cond,
if b then pp_comma_a else empty,
char '\t',
- ppr (mkAsmTempLabel (getUnique blockid))
+ ppr (blockLbl blockid)
]
pprInstr (JMP addr) = text "\tjmp\t" <> pprAddr addr
diff --git a/compiler/nativeGen/SPARC/ShortcutJump.hs b/compiler/nativeGen/SPARC/ShortcutJump.hs
index 123a345130..0bbcc48f94 100644
--- a/compiler/nativeGen/SPARC/ShortcutJump.hs
+++ b/compiler/nativeGen/SPARC/ShortcutJump.hs
@@ -16,8 +16,6 @@ import BlockId
import Cmm
import Panic
-import Unique
-
data JumpDest
@@ -63,7 +61,7 @@ shortcutStatic _ other_static
shortBlockId :: (BlockId -> Maybe JumpDest) -> BlockId -> CLabel
shortBlockId fn blockid =
case fn blockid of
- Nothing -> mkAsmTempLabel (getUnique blockid)
+ Nothing -> blockLbl blockid
Just (DestBlockId blockid') -> shortBlockId fn blockid'
Just (DestImm (ImmCLbl lbl)) -> lbl
_other -> panic "shortBlockId"