-pprLit lit
- = getPprStyle $ \ sty ->
- let
- code_style = codeStyle sty
- in
- case lit of
- MachChar ch | code_style -> hcat [ptext SLIT("(C_)"), char '\'',
- text (charToC ch), char '\'']
- | ifaceStyle sty -> char '\'' <> text (charToEasyHaskell ch) <> char '\''
- | otherwise -> text ['\'', ch, '\'']
-
- MachStr s | code_style -> pprFSInCStyle s
- | otherwise -> pprFSAsString s
-
- MachInt i | code_style && i == tARGET_MIN_INT -> parens (integer (i+1) <> text "-1")
- -- Avoid a problem whereby gcc interprets
- -- the constant minInt as unsigned.
- | otherwise -> pprIntVal i
-
- MachInt64 i | code_style -> pprIntVal i -- Same problem with gcc???
- | otherwise -> ptext SLIT("__int64") <+> integer i
-
- MachWord w | code_style -> pprHexVal w
- | otherwise -> ptext SLIT("__word") <+> integer w
-
- MachWord64 w | code_style -> pprHexVal w
- | otherwise -> ptext SLIT("__word64") <+> integer w
-
- MachFloat f | code_style -> ptext SLIT("(StgFloat)") <> rational f
- | otherwise -> ptext SLIT("__float") <+> rational f
-
- MachDouble d | ifaceStyle sty && d < 0 -> parens (rational d)
- | otherwise -> rational d
-
- MachAddr p | code_style -> ptext SLIT("(void*)") <> integer p
- | otherwise -> ptext SLIT("__addr") <+> integer p
-
- MachLitLit s ty | code_style -> ptext s
- | otherwise -> parens (hsep [ptext SLIT("__litlit"),
- pprFSAsString s,
- pprParendType ty])
+pprLit (MachChar ch) = pprHsChar ch
+pprLit (MachStr s) = pprHsString s
+pprLit (MachInt i) = pprIntVal i
+pprLit (MachInt64 i) = ptext SLIT("__int64") <+> integer i
+pprLit (MachWord w) = ptext SLIT("__word") <+> integer w
+pprLit (MachWord64 w) = ptext SLIT("__word64") <+> integer w
+pprLit (MachFloat f) = ptext SLIT("__float") <+> rational f
+pprLit (MachDouble d) = rational d
+pprLit (MachNullAddr) = ptext SLIT("__NULL")
+pprLit (MachLabel l mb) = ptext SLIT("__label") <+>
+ case mb of
+ Nothing -> pprHsString l
+ Just x -> doubleQuotes (text (unpackFS l ++ '@':show x))