mkAltLabel,
mkDefaultLabel,
mkBitmapLabel,
+ mkStringLitLabel,
mkClosureTblLabel,
| AsmTempLabel
{-# UNPACK #-} !Unique
+ | StringLitLabel
+ {-# UNPACK #-} !Unique
+
| ModuleInitLabel
Module -- the module name
String -- its "way"
mkAltLabel uniq tag = CaseLabel uniq (CaseAlt tag)
mkDefaultLabel uniq = CaseLabel uniq CaseDefault
+mkStringLitLabel = StringLitLabel
mkAsmTempLabel = AsmTempLabel
mkModuleInitLabel = ModuleInitLabel
needsCDecl ModuleRegdLabel = False
needsCDecl (CaseLabel _ _) = False
+needsCDecl (StringLitLabel _) = False
needsCDecl (AsmTempLabel _) = False
needsCDecl (RtsLabel _) = False
needsCDecl (ForeignLabel _ _ _) = False
externallyVisibleCLabel :: CLabel -> Bool -- not C "static"
externallyVisibleCLabel (CaseLabel _ _) = False
+externallyVisibleCLabel (StringLitLabel _) = False
externallyVisibleCLabel (AsmTempLabel _) = False
externallyVisibleCLabel (ModuleInitLabel _ _)= True
externallyVisibleCLabel (PlainModuleInitLabel _)= True
pprAsmCLbl lbl
= pprCLbl lbl
+pprCLbl (StringLitLabel u)
+ = pprUnique u <> ptext SLIT("_str")
+
pprCLbl (CaseLabel u CaseReturnPt)
= hcat [pprUnique u, ptext SLIT("_ret")]
pprCLbl (CaseLabel u CaseReturnInfo)
mo_wordULt, machRepByteWidth )
import ForeignCall ( CCallConv(..) )
import Literal ( Literal(..) )
-import CLabel ( CLabel, mkAsmTempLabel )
+import CLabel ( CLabel, mkStringLitLabel )
import Digraph ( SCC(..), stronglyConnComp )
import ListSetOps ( assocDefault )
import Util ( filterOut, sortLe )
-- and return its label
mkStringCLit str
= do { uniq <- newUnique
- ; let lbl = mkAsmTempLabel uniq
+ ; let lbl = mkStringLitLabel uniq
; emitData ReadOnlyData [CmmDataLabel lbl, CmmString str]
; return (CmmLabel lbl) }
$chkcat[$i] = 'data';
$chksymb[$i] = '';
- # Labels beginning "_c": these are literal strings.
- } elsif ( /^${T_US}_c.*$/ ) {
+ # Labels ending "_str": these are literal strings.
+ } elsif ( /^${T_US}([A-Za-z0-9_]+)_str${T_POST_LBL}$/ ) {
$chk[++$i] = $_;
$chkcat[$i] = 'rodata';
$chksymb[$i] = '';