Snapshot of codegen refactoring to share with simonpj
[ghc.git] / compiler / cmm / CLabel.hs
1 {-# OPTIONS -w #-}
2 -- The above warning supression flag is a temporary kludge.
3 -- While working on this module you are encouraged to remove it and fix
4 -- any warnings in the module. See
5 -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
6 -- for details
7
8 -----------------------------------------------------------------------------
9 --
10 -- Object-file symbols (called CLabel for histerical raisins).
11 --
12 -- (c) The University of Glasgow 2004-2006
13 --
14 -----------------------------------------------------------------------------
15
16 module CLabel (
17 CLabel, -- abstract type
18 ForeignLabelSource(..),
19 pprDebugCLabel,
20
21 mkClosureLabel,
22 mkSRTLabel,
23 mkInfoTableLabel,
24 mkEntryLabel,
25 mkSlowEntryLabel, slowEntryFromInfoLabel,
26 mkConEntryLabel,
27 mkStaticConEntryLabel,
28 mkRednCountsLabel,
29 mkConInfoTableLabel,
30 mkStaticInfoTableLabel,
31 mkLargeSRTLabel,
32 mkApEntryLabel,
33 mkApInfoTableLabel,
34 mkClosureTableLabel,
35
36 mkLocalClosureLabel,
37 mkLocalInfoTableLabel,
38 mkLocalEntryLabel,
39 mkLocalConEntryLabel,
40 mkLocalStaticConEntryLabel,
41 mkLocalConInfoTableLabel,
42 mkLocalStaticInfoTableLabel,
43 mkLocalClosureTableLabel,
44
45 mkReturnPtLabel,
46 mkReturnInfoLabel,
47 mkAltLabel,
48 mkDefaultLabel,
49 mkBitmapLabel,
50 mkStringLitLabel,
51
52 mkAsmTempLabel,
53
54 mkPlainModuleInitLabel,
55
56 mkSplitMarkerLabel,
57 mkDirty_MUT_VAR_Label,
58 mkUpdInfoLabel,
59 mkBHUpdInfoLabel,
60 mkIndStaticInfoLabel,
61 mkMainCapabilityLabel,
62 mkMAP_FROZEN_infoLabel,
63 mkMAP_DIRTY_infoLabel,
64 mkEMPTY_MVAR_infoLabel,
65
66 mkTopTickyCtrLabel,
67 mkCAFBlackHoleInfoTableLabel,
68 mkCAFBlackHoleEntryLabel,
69 mkRtsPrimOpLabel,
70 mkRtsSlowTickyCtrLabel,
71
72 mkSelectorInfoLabel,
73 mkSelectorEntryLabel,
74
75 mkCmmInfoLabel,
76 mkCmmEntryLabel,
77 mkCmmRetInfoLabel,
78 mkCmmRetLabel,
79 mkCmmCodeLabel,
80 mkCmmDataLabel,
81 mkCmmGcPtrLabel,
82
83 mkRtsApFastLabel,
84
85 mkPrimCallLabel,
86
87 mkForeignLabel,
88 addLabelSize,
89 foreignLabelStdcallInfo,
90
91 mkCCLabel, mkCCSLabel,
92
93 DynamicLinkerLabelInfo(..),
94 mkDynamicLinkerLabel,
95 dynamicLinkerLabelInfo,
96
97 mkPicBaseLabel,
98 mkDeadStripPreventer,
99
100 mkHpcTicksLabel,
101
102 hasCAF,
103 cvtToClosureLbl,
104 needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel,
105 isMathFun,
106 isCFunctionLabel, isGcPtrLabel, labelDynamic,
107
108 pprCLabel
109 ) where
110
111 #include "HsVersions.h"
112
113 import IdInfo
114 import StaticFlags
115 import BasicTypes
116 import Literal
117 import Packages
118 import DataCon
119 import PackageConfig
120 import Module
121 import Name
122 import Unique
123 import PrimOp
124 import Config
125 import CostCentre
126 import Outputable
127 import FastString
128 import DynFlags
129 import UniqSet
130
131 -- -----------------------------------------------------------------------------
132 -- The CLabel type
133
134 {-
135 | CLabel is an abstract type that supports the following operations:
136
137 - Pretty printing
138
139 - In a C file, does it need to be declared before use? (i.e. is it
140 guaranteed to be already in scope in the places we need to refer to it?)
141
142 - If it needs to be declared, what type (code or data) should it be
143 declared to have?
144
145 - Is it visible outside this object file or not?
146
147 - Is it "dynamic" (see details below)
148
149 - Eq and Ord, so that we can make sets of CLabels (currently only
150 used in outputting C as far as I can tell, to avoid generating
151 more than one declaration for any given label).
152
153 - Converting an info table label into an entry label.
154 -}
155
156 data CLabel
157 = -- | A label related to the definition of a particular Id or Con in a .hs file.
158 IdLabel
159 Name
160 CafInfo
161 IdLabelInfo -- encodes the suffix of the label
162
163 -- | A label from a .cmm file that is not associated with a .hs level Id.
164 | CmmLabel
165 PackageId -- what package the label belongs to.
166 FastString -- identifier giving the prefix of the label
167 CmmLabelInfo -- encodes the suffix of the label
168
169 -- | A label with a baked-in \/ algorithmically generated name that definitely
170 -- comes from the RTS. The code for it must compile into libHSrts.a \/ libHSrts.so
171 -- If it doesn't have an algorithmically generated name then use a CmmLabel
172 -- instead and give it an appropriate PackageId argument.
173 | RtsLabel
174 RtsLabelInfo
175
176 -- | A 'C' (or otherwise foreign) label.
177 --
178 | ForeignLabel
179 FastString -- name of the imported label.
180
181 (Maybe Int) -- possible '@n' suffix for stdcall functions
182 -- When generating C, the '@n' suffix is omitted, but when
183 -- generating assembler we must add it to the label.
184
185 ForeignLabelSource -- what package the foreign label is in.
186
187 FunctionOrData
188
189 -- | A family of labels related to a particular case expression.
190 | CaseLabel
191 {-# UNPACK #-} !Unique -- Unique says which case expression
192 CaseLabelInfo
193
194 | AsmTempLabel
195 {-# UNPACK #-} !Unique
196
197 | StringLitLabel
198 {-# UNPACK #-} !Unique
199
200 | PlainModuleInitLabel -- without the version & way info
201 Module
202
203 | CC_Label CostCentre
204 | CCS_Label CostCentreStack
205
206
207 -- | These labels are generated and used inside the NCG only.
208 -- They are special variants of a label used for dynamic linking
209 -- see module PositionIndependentCode for details.
210 | DynamicLinkerLabel DynamicLinkerLabelInfo CLabel
211
212 -- | This label is generated and used inside the NCG only.
213 -- It is used as a base for PIC calculations on some platforms.
214 -- It takes the form of a local numeric assembler label '1'; and
215 -- is pretty-printed as 1b, referring to the previous definition
216 -- of 1: in the assembler source file.
217 | PicBaseLabel
218
219 -- | A label before an info table to prevent excessive dead-stripping on darwin
220 | DeadStripPreventer CLabel
221
222
223 -- | Per-module table of tick locations
224 | HpcTicksLabel Module
225
226 -- | Label of an StgLargeSRT
227 | LargeSRTLabel
228 {-# UNPACK #-} !Unique
229
230 -- | A bitmap (function or case return)
231 | LargeBitmapLabel
232 {-# UNPACK #-} !Unique
233
234 deriving (Eq, Ord)
235
236
237 -- | Record where a foreign label is stored.
238 data ForeignLabelSource
239
240 -- | Label is in a named package
241 = ForeignLabelInPackage PackageId
242
243 -- | Label is in some external, system package that doesn't also
244 -- contain compiled Haskell code, and is not associated with any .hi files.
245 -- We don't have to worry about Haskell code being inlined from
246 -- external packages. It is safe to treat the RTS package as "external".
247 | ForeignLabelInExternalPackage
248
249 -- | Label is in the package currenly being compiled.
250 -- This is only used for creating hacky tmp labels during code generation.
251 -- Don't use it in any code that might be inlined across a package boundary
252 -- (ie, core code) else the information will be wrong relative to the
253 -- destination module.
254 | ForeignLabelInThisPackage
255
256 deriving (Eq, Ord)
257
258
259 -- | For debugging problems with the CLabel representation.
260 -- We can't make a Show instance for CLabel because lots of its components don't have instances.
261 -- The regular Outputable instance only shows the label name, and not its other info.
262 --
263 pprDebugCLabel :: CLabel -> SDoc
264 pprDebugCLabel lbl
265 = case lbl of
266 IdLabel{} -> ppr lbl <> (parens $ text "IdLabel")
267 CmmLabel pkg name _info
268 -> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg)
269
270 RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel")
271
272 ForeignLabel name mSuffix src funOrData
273 -> ppr lbl <> (parens
274 $ text "ForeignLabel"
275 <+> ppr mSuffix
276 <+> ppr src
277 <+> ppr funOrData)
278
279 _ -> ppr lbl <> (parens $ text "other CLabel)")
280
281
282 -- True if a local IdLabel that we won't mark as exported
283 type IsLocal = Bool
284
285 data IdLabelInfo
286 = Closure -- ^ Label for closure
287 | SRT -- ^ Static reference table
288 | InfoTable IsLocal -- ^ Info tables for closures; always read-only
289 | Entry -- ^ Entry point
290 | Slow -- ^ Slow entry point
291
292 | RednCounts -- ^ Label of place to keep Ticky-ticky info for this Id
293
294 | ConEntry -- ^ Constructor entry point
295 | ConInfoTable -- ^ Corresponding info table
296 | StaticConEntry -- ^ Static constructor entry point
297 | StaticInfoTable -- ^ Corresponding info table
298
299 | ClosureTable -- ^ Table of closures for Enum tycons
300
301 deriving (Eq, Ord)
302
303
304 data CaseLabelInfo
305 = CaseReturnPt
306 | CaseReturnInfo
307 | CaseAlt ConTag
308 | CaseDefault
309 deriving (Eq, Ord)
310
311
312 data RtsLabelInfo
313 = RtsSelectorInfoTable Bool{-updatable-} Int{-offset-} -- ^ Selector thunks
314 | RtsSelectorEntry Bool{-updatable-} Int{-offset-}
315
316 | RtsApInfoTable Bool{-updatable-} Int{-arity-} -- ^ AP thunks
317 | RtsApEntry Bool{-updatable-} Int{-arity-}
318
319 | RtsPrimOp PrimOp
320 | RtsApFast FastString -- ^ _fast versions of generic apply
321 | RtsSlowTickyCtr String
322
323 deriving (Eq, Ord)
324 -- NOTE: Eq on LitString compares the pointer only, so this isn't
325 -- a real equality.
326
327
328 -- | What type of Cmm label we're dealing with.
329 -- Determines the suffix appended to the name when a CLabel.CmmLabel
330 -- is pretty printed.
331 data CmmLabelInfo
332 = CmmInfo -- ^ misc rts info tabless, suffix _info
333 | CmmEntry -- ^ misc rts entry points, suffix _entry
334 | CmmRetInfo -- ^ misc rts ret info tables, suffix _info
335 | CmmRet -- ^ misc rts return points, suffix _ret
336 | CmmData -- ^ misc rts data bits, eg CHARLIKE_closure
337 | CmmCode -- ^ misc rts code
338 | CmmGcPtr -- ^ GcPtrs eg CHARLIKE_closure
339 | CmmPrimCall -- ^ a prim call to some hand written Cmm code
340 deriving (Eq, Ord)
341
342 data DynamicLinkerLabelInfo
343 = CodeStub -- MachO: Lfoo$stub, ELF: foo@plt
344 | SymbolPtr -- MachO: Lfoo$non_lazy_ptr, Windows: __imp_foo
345 | GotSymbolPtr -- ELF: foo@got
346 | GotSymbolOffset -- ELF: foo@gotoff
347
348 deriving (Eq, Ord)
349
350
351 -- -----------------------------------------------------------------------------
352 -- Constructing CLabels
353 -- -----------------------------------------------------------------------------
354
355 -- Constructing IdLabels
356 -- These are always local:
357 mkSlowEntryLabel name c = IdLabel name c Slow
358 slowEntryFromInfoLabel (IdLabel n c _) = IdLabel n c Slow
359
360 mkSRTLabel name c = IdLabel name c SRT
361 mkRednCountsLabel name c = IdLabel name c RednCounts
362
363 -- These have local & (possibly) external variants:
364 mkLocalClosureLabel name c = IdLabel name c Closure
365 mkLocalInfoTableLabel name c = IdLabel name c (InfoTable True)
366 mkLocalEntryLabel name c = IdLabel name c Entry
367 mkLocalClosureTableLabel name c = IdLabel name c ClosureTable
368
369 mkClosureLabel name c = IdLabel name c Closure
370 mkInfoTableLabel name c = IdLabel name c (InfoTable False)
371 mkEntryLabel name c = IdLabel name c Entry
372 mkClosureTableLabel name c = IdLabel name c ClosureTable
373 mkLocalConInfoTableLabel c con = IdLabel con c ConInfoTable
374 mkLocalConEntryLabel c con = IdLabel con c ConEntry
375 mkLocalStaticInfoTableLabel c con = IdLabel con c StaticInfoTable
376 mkLocalStaticConEntryLabel c con = IdLabel con c StaticConEntry
377 mkConInfoTableLabel name c = IdLabel name c ConInfoTable
378 mkStaticInfoTableLabel name c = IdLabel name c StaticInfoTable
379
380 mkConEntryLabel name c = IdLabel name c ConEntry
381 mkStaticConEntryLabel name c = IdLabel name c StaticConEntry
382
383 -- Constructing Cmm Labels
384 mkSplitMarkerLabel = CmmLabel rtsPackageId (fsLit "__stg_split_marker") CmmCode
385 mkDirty_MUT_VAR_Label = CmmLabel rtsPackageId (fsLit "dirty_MUT_VAR") CmmCode
386 mkUpdInfoLabel = CmmLabel rtsPackageId (fsLit "stg_upd_frame") CmmInfo
387 mkBHUpdInfoLabel = CmmLabel rtsPackageId (fsLit "stg_bh_upd_frame" ) CmmInfo
388 mkIndStaticInfoLabel = CmmLabel rtsPackageId (fsLit "stg_IND_STATIC") CmmInfo
389 mkMainCapabilityLabel = CmmLabel rtsPackageId (fsLit "MainCapability") CmmData
390 mkMAP_FROZEN_infoLabel = CmmLabel rtsPackageId (fsLit "stg_MUT_ARR_PTRS_FROZEN0") CmmInfo
391 mkMAP_DIRTY_infoLabel = CmmLabel rtsPackageId (fsLit "stg_MUT_ARR_PTRS_DIRTY") CmmInfo
392 mkEMPTY_MVAR_infoLabel = CmmLabel rtsPackageId (fsLit "stg_EMPTY_MVAR") CmmInfo
393 mkTopTickyCtrLabel = CmmLabel rtsPackageId (fsLit "top_ct") CmmData
394 mkCAFBlackHoleInfoTableLabel = CmmLabel rtsPackageId (fsLit "stg_CAF_BLACKHOLE") CmmInfo
395 mkCAFBlackHoleEntryLabel = CmmLabel rtsPackageId (fsLit "stg_CAF_BLACKHOLE") CmmEntry
396
397 -----
398 mkCmmInfoLabel, mkCmmEntryLabel, mkCmmRetInfoLabel, mkCmmRetLabel,
399 mkCmmCodeLabel, mkCmmDataLabel, mkCmmGcPtrLabel
400 :: PackageId -> FastString -> CLabel
401
402 mkCmmInfoLabel pkg str = CmmLabel pkg str CmmInfo
403 mkCmmEntryLabel pkg str = CmmLabel pkg str CmmEntry
404 mkCmmRetInfoLabel pkg str = CmmLabel pkg str CmmRetInfo
405 mkCmmRetLabel pkg str = CmmLabel pkg str CmmRet
406 mkCmmCodeLabel pkg str = CmmLabel pkg str CmmCode
407 mkCmmDataLabel pkg str = CmmLabel pkg str CmmData
408 mkCmmGcPtrLabel pkg str = CmmLabel pkg str CmmGcPtr
409
410
411 -- Constructing RtsLabels
412 mkRtsPrimOpLabel primop = RtsLabel (RtsPrimOp primop)
413
414 mkSelectorInfoLabel upd off = RtsLabel (RtsSelectorInfoTable upd off)
415 mkSelectorEntryLabel upd off = RtsLabel (RtsSelectorEntry upd off)
416
417 mkApInfoTableLabel upd off = RtsLabel (RtsApInfoTable upd off)
418 mkApEntryLabel upd off = RtsLabel (RtsApEntry upd off)
419
420
421 -- A call to some primitive hand written Cmm code
422 mkPrimCallLabel :: PrimCall -> CLabel
423 mkPrimCallLabel (PrimCall str pkg)
424 = CmmLabel pkg str CmmPrimCall
425
426
427 -- Constructing ForeignLabels
428
429 -- | Make a foreign label
430 mkForeignLabel
431 :: FastString -- name
432 -> Maybe Int -- size prefix
433 -> ForeignLabelSource -- what package it's in
434 -> FunctionOrData
435 -> CLabel
436
437 mkForeignLabel str mb_sz src fod
438 = ForeignLabel str mb_sz src fod
439
440
441 -- | Update the label size field in a ForeignLabel
442 addLabelSize :: CLabel -> Int -> CLabel
443 addLabelSize (ForeignLabel str _ src fod) sz
444 = ForeignLabel str (Just sz) src fod
445 addLabelSize label _
446 = label
447
448 -- | Get the label size field from a ForeignLabel
449 foreignLabelStdcallInfo :: CLabel -> Maybe Int
450 foreignLabelStdcallInfo (ForeignLabel _ info _ _) = info
451 foreignLabelStdcallInfo _lbl = Nothing
452
453
454 -- Constructing Large*Labels
455 mkLargeSRTLabel uniq = LargeSRTLabel uniq
456 mkBitmapLabel uniq = LargeBitmapLabel uniq
457
458
459 -- Constructin CaseLabels
460 mkReturnPtLabel uniq = CaseLabel uniq CaseReturnPt
461 mkReturnInfoLabel uniq = CaseLabel uniq CaseReturnInfo
462 mkAltLabel uniq tag = CaseLabel uniq (CaseAlt tag)
463 mkDefaultLabel uniq = CaseLabel uniq CaseDefault
464
465 -- Constructing Cost Center Labels
466 mkCCLabel cc = CC_Label cc
467 mkCCSLabel ccs = CCS_Label ccs
468
469 mkRtsApFastLabel str = RtsLabel (RtsApFast str)
470
471 mkRtsSlowTickyCtrLabel :: String -> CLabel
472 mkRtsSlowTickyCtrLabel pat = RtsLabel (RtsSlowTickyCtr pat)
473
474
475 -- Constructing Code Coverage Labels
476 mkHpcTicksLabel = HpcTicksLabel
477
478
479 -- Constructing labels used for dynamic linking
480 mkDynamicLinkerLabel :: DynamicLinkerLabelInfo -> CLabel -> CLabel
481 mkDynamicLinkerLabel = DynamicLinkerLabel
482
483 dynamicLinkerLabelInfo :: CLabel -> Maybe (DynamicLinkerLabelInfo, CLabel)
484 dynamicLinkerLabelInfo (DynamicLinkerLabel info lbl) = Just (info, lbl)
485 dynamicLinkerLabelInfo _ = Nothing
486
487 mkPicBaseLabel :: CLabel
488 mkPicBaseLabel = PicBaseLabel
489
490
491 -- Constructing miscellaneous other labels
492 mkDeadStripPreventer :: CLabel -> CLabel
493 mkDeadStripPreventer lbl = DeadStripPreventer lbl
494
495 mkStringLitLabel :: Unique -> CLabel
496 mkStringLitLabel = StringLitLabel
497
498 mkAsmTempLabel :: Uniquable a => a -> CLabel
499 mkAsmTempLabel a = AsmTempLabel (getUnique a)
500
501 mkPlainModuleInitLabel :: Module -> CLabel
502 mkPlainModuleInitLabel mod = PlainModuleInitLabel mod
503
504 -- -----------------------------------------------------------------------------
505 -- Brutal method of obtaining a closure label
506
507 cvtToClosureLbl (IdLabel n c (InfoTable _)) = IdLabel n c Closure
508 cvtToClosureLbl (IdLabel n c Entry) = IdLabel n c Closure
509 cvtToClosureLbl (IdLabel n c ConEntry) = IdLabel n c Closure
510 cvtToClosureLbl (IdLabel n c RednCounts) = IdLabel n c Closure
511 cvtToClosureLbl l@(IdLabel n c Closure) = l
512 cvtToClosureLbl l
513 = pprPanic "cvtToClosureLbl" (pprCLabel l)
514
515
516 -- -----------------------------------------------------------------------------
517 -- Does a CLabel refer to a CAF?
518 hasCAF :: CLabel -> Bool
519 hasCAF (IdLabel _ MayHaveCafRefs _) = True
520 hasCAF _ = False
521
522
523 -- -----------------------------------------------------------------------------
524 -- Does a CLabel need declaring before use or not?
525 --
526 -- See wiki:Commentary/Compiler/Backends/PprC#Prototypes
527
528 needsCDecl :: CLabel -> Bool
529 -- False <=> it's pre-declared; don't bother
530 -- don't bother declaring SRT & Bitmap labels, we always make sure
531 -- they are defined before use.
532 needsCDecl (IdLabel _ _ SRT) = False
533 needsCDecl (LargeSRTLabel _) = False
534 needsCDecl (LargeBitmapLabel _) = False
535 needsCDecl (IdLabel _ _ _) = True
536 needsCDecl (CaseLabel _ _) = True
537 needsCDecl (PlainModuleInitLabel _) = True
538
539 needsCDecl (StringLitLabel _) = False
540 needsCDecl (AsmTempLabel _) = False
541 needsCDecl (RtsLabel _) = False
542
543 needsCDecl (CmmLabel pkgId _ _)
544 -- Prototypes for labels defined in the runtime system are imported
545 -- into HC files via includes/Stg.h.
546 | pkgId == rtsPackageId = False
547
548 -- For other labels we inline one into the HC file directly.
549 | otherwise = True
550
551 needsCDecl l@(ForeignLabel{}) = not (isMathFun l)
552 needsCDecl (CC_Label _) = True
553 needsCDecl (CCS_Label _) = True
554 needsCDecl (HpcTicksLabel _) = True
555
556
557 -- | Check whether a label is a local temporary for native code generation
558 isAsmTemp :: CLabel -> Bool
559 isAsmTemp (AsmTempLabel _) = True
560 isAsmTemp _ = False
561
562
563 -- | If a label is a local temporary used for native code generation
564 -- then return just its unique, otherwise nothing.
565 maybeAsmTemp :: CLabel -> Maybe Unique
566 maybeAsmTemp (AsmTempLabel uq) = Just uq
567 maybeAsmTemp _ = Nothing
568
569
570 -- | Check whether a label corresponds to a C function that has
571 -- a prototype in a system header somehere, or is built-in
572 -- to the C compiler. For these labels we avoid generating our
573 -- own C prototypes.
574 isMathFun :: CLabel -> Bool
575 isMathFun (ForeignLabel fs _ _ _) = fs `elementOfUniqSet` math_funs
576 isMathFun _ = False
577
578 math_funs = mkUniqSet [
579 -- _ISOC99_SOURCE
580 (fsLit "acos"), (fsLit "acosf"), (fsLit "acosh"),
581 (fsLit "acoshf"), (fsLit "acoshl"), (fsLit "acosl"),
582 (fsLit "asin"), (fsLit "asinf"), (fsLit "asinl"),
583 (fsLit "asinh"), (fsLit "asinhf"), (fsLit "asinhl"),
584 (fsLit "atan"), (fsLit "atanf"), (fsLit "atanl"),
585 (fsLit "atan2"), (fsLit "atan2f"), (fsLit "atan2l"),
586 (fsLit "atanh"), (fsLit "atanhf"), (fsLit "atanhl"),
587 (fsLit "cbrt"), (fsLit "cbrtf"), (fsLit "cbrtl"),
588 (fsLit "ceil"), (fsLit "ceilf"), (fsLit "ceill"),
589 (fsLit "copysign"), (fsLit "copysignf"), (fsLit "copysignl"),
590 (fsLit "cos"), (fsLit "cosf"), (fsLit "cosl"),
591 (fsLit "cosh"), (fsLit "coshf"), (fsLit "coshl"),
592 (fsLit "erf"), (fsLit "erff"), (fsLit "erfl"),
593 (fsLit "erfc"), (fsLit "erfcf"), (fsLit "erfcl"),
594 (fsLit "exp"), (fsLit "expf"), (fsLit "expl"),
595 (fsLit "exp2"), (fsLit "exp2f"), (fsLit "exp2l"),
596 (fsLit "expm1"), (fsLit "expm1f"), (fsLit "expm1l"),
597 (fsLit "fabs"), (fsLit "fabsf"), (fsLit "fabsl"),
598 (fsLit "fdim"), (fsLit "fdimf"), (fsLit "fdiml"),
599 (fsLit "floor"), (fsLit "floorf"), (fsLit "floorl"),
600 (fsLit "fma"), (fsLit "fmaf"), (fsLit "fmal"),
601 (fsLit "fmax"), (fsLit "fmaxf"), (fsLit "fmaxl"),
602 (fsLit "fmin"), (fsLit "fminf"), (fsLit "fminl"),
603 (fsLit "fmod"), (fsLit "fmodf"), (fsLit "fmodl"),
604 (fsLit "frexp"), (fsLit "frexpf"), (fsLit "frexpl"),
605 (fsLit "hypot"), (fsLit "hypotf"), (fsLit "hypotl"),
606 (fsLit "ilogb"), (fsLit "ilogbf"), (fsLit "ilogbl"),
607 (fsLit "ldexp"), (fsLit "ldexpf"), (fsLit "ldexpl"),
608 (fsLit "lgamma"), (fsLit "lgammaf"), (fsLit "lgammal"),
609 (fsLit "llrint"), (fsLit "llrintf"), (fsLit "llrintl"),
610 (fsLit "llround"), (fsLit "llroundf"), (fsLit "llroundl"),
611 (fsLit "log"), (fsLit "logf"), (fsLit "logl"),
612 (fsLit "log10l"), (fsLit "log10"), (fsLit "log10f"),
613 (fsLit "log1pl"), (fsLit "log1p"), (fsLit "log1pf"),
614 (fsLit "log2"), (fsLit "log2f"), (fsLit "log2l"),
615 (fsLit "logb"), (fsLit "logbf"), (fsLit "logbl"),
616 (fsLit "lrint"), (fsLit "lrintf"), (fsLit "lrintl"),
617 (fsLit "lround"), (fsLit "lroundf"), (fsLit "lroundl"),
618 (fsLit "modf"), (fsLit "modff"), (fsLit "modfl"),
619 (fsLit "nan"), (fsLit "nanf"), (fsLit "nanl"),
620 (fsLit "nearbyint"), (fsLit "nearbyintf"), (fsLit "nearbyintl"),
621 (fsLit "nextafter"), (fsLit "nextafterf"), (fsLit "nextafterl"),
622 (fsLit "nexttoward"), (fsLit "nexttowardf"), (fsLit "nexttowardl"),
623 (fsLit "pow"), (fsLit "powf"), (fsLit "powl"),
624 (fsLit "remainder"), (fsLit "remainderf"), (fsLit "remainderl"),
625 (fsLit "remquo"), (fsLit "remquof"), (fsLit "remquol"),
626 (fsLit "rint"), (fsLit "rintf"), (fsLit "rintl"),
627 (fsLit "round"), (fsLit "roundf"), (fsLit "roundl"),
628 (fsLit "scalbln"), (fsLit "scalblnf"), (fsLit "scalblnl"),
629 (fsLit "scalbn"), (fsLit "scalbnf"), (fsLit "scalbnl"),
630 (fsLit "sin"), (fsLit "sinf"), (fsLit "sinl"),
631 (fsLit "sinh"), (fsLit "sinhf"), (fsLit "sinhl"),
632 (fsLit "sqrt"), (fsLit "sqrtf"), (fsLit "sqrtl"),
633 (fsLit "tan"), (fsLit "tanf"), (fsLit "tanl"),
634 (fsLit "tanh"), (fsLit "tanhf"), (fsLit "tanhl"),
635 (fsLit "tgamma"), (fsLit "tgammaf"), (fsLit "tgammal"),
636 (fsLit "trunc"), (fsLit "truncf"), (fsLit "truncl"),
637 -- ISO C 99 also defines these function-like macros in math.h:
638 -- fpclassify, isfinite, isinf, isnormal, signbit, isgreater,
639 -- isgreaterequal, isless, islessequal, islessgreater, isunordered
640
641 -- additional symbols from _BSD_SOURCE
642 (fsLit "drem"), (fsLit "dremf"), (fsLit "dreml"),
643 (fsLit "finite"), (fsLit "finitef"), (fsLit "finitel"),
644 (fsLit "gamma"), (fsLit "gammaf"), (fsLit "gammal"),
645 (fsLit "isinf"), (fsLit "isinff"), (fsLit "isinfl"),
646 (fsLit "isnan"), (fsLit "isnanf"), (fsLit "isnanl"),
647 (fsLit "j0"), (fsLit "j0f"), (fsLit "j0l"),
648 (fsLit "j1"), (fsLit "j1f"), (fsLit "j1l"),
649 (fsLit "jn"), (fsLit "jnf"), (fsLit "jnl"),
650 (fsLit "lgamma_r"), (fsLit "lgammaf_r"), (fsLit "lgammal_r"),
651 (fsLit "scalb"), (fsLit "scalbf"), (fsLit "scalbl"),
652 (fsLit "significand"), (fsLit "significandf"), (fsLit "significandl"),
653 (fsLit "y0"), (fsLit "y0f"), (fsLit "y0l"),
654 (fsLit "y1"), (fsLit "y1f"), (fsLit "y1l"),
655 (fsLit "yn"), (fsLit "ynf"), (fsLit "ynl")
656 ]
657
658 -- -----------------------------------------------------------------------------
659 -- | Is a CLabel visible outside this object file or not?
660 -- From the point of view of the code generator, a name is
661 -- externally visible if it has to be declared as exported
662 -- in the .o file's symbol table; that is, made non-static.
663 externallyVisibleCLabel :: CLabel -> Bool -- not C "static"
664 externallyVisibleCLabel (CaseLabel _ _) = False
665 externallyVisibleCLabel (StringLitLabel _) = False
666 externallyVisibleCLabel (AsmTempLabel _) = False
667 externallyVisibleCLabel (PlainModuleInitLabel _)= True
668 externallyVisibleCLabel (RtsLabel _) = True
669 externallyVisibleCLabel (CmmLabel _ _ _) = True
670 externallyVisibleCLabel (ForeignLabel{}) = True
671 externallyVisibleCLabel (IdLabel name _ info) = isExternalName name && externallyVisibleIdLabel info
672 externallyVisibleCLabel (CC_Label _) = True
673 externallyVisibleCLabel (CCS_Label _) = True
674 externallyVisibleCLabel (DynamicLinkerLabel _ _) = False
675 externallyVisibleCLabel (HpcTicksLabel _) = True
676 externallyVisibleCLabel (LargeBitmapLabel _) = False
677 externallyVisibleCLabel (LargeSRTLabel _) = False
678
679 externallyVisibleIdLabel :: IdLabelInfo -> Bool
680 externallyVisibleIdLabel SRT = False
681 externallyVisibleIdLabel (InfoTable lcl) = not lcl
682 externallyVisibleIdLabel _ = True
683
684 -- -----------------------------------------------------------------------------
685 -- Finding the "type" of a CLabel
686
687 -- For generating correct types in label declarations:
688
689 data CLabelType
690 = CodeLabel -- Address of some executable instructions
691 | DataLabel -- Address of data, not a GC ptr
692 | GcPtrLabel -- Address of a (presumably static) GC object
693
694 isCFunctionLabel :: CLabel -> Bool
695 isCFunctionLabel lbl = case labelType lbl of
696 CodeLabel -> True
697 _other -> False
698
699 isGcPtrLabel :: CLabel -> Bool
700 isGcPtrLabel lbl = case labelType lbl of
701 GcPtrLabel -> True
702 _other -> False
703
704
705 -- | Work out the general type of data at the address of this label
706 -- whether it be code, data, or static GC object.
707 labelType :: CLabel -> CLabelType
708 labelType (CmmLabel _ _ CmmData) = DataLabel
709 labelType (CmmLabel _ _ CmmGcPtr) = GcPtrLabel
710 labelType (CmmLabel _ _ CmmCode) = CodeLabel
711 labelType (CmmLabel _ _ CmmInfo) = DataLabel
712 labelType (CmmLabel _ _ CmmEntry) = CodeLabel
713 labelType (CmmLabel _ _ CmmRetInfo) = DataLabel
714 labelType (CmmLabel _ _ CmmRet) = CodeLabel
715 labelType (RtsLabel (RtsSelectorInfoTable _ _)) = DataLabel
716 labelType (RtsLabel (RtsApInfoTable _ _)) = DataLabel
717 labelType (RtsLabel (RtsApFast _)) = CodeLabel
718 labelType (CaseLabel _ CaseReturnInfo) = DataLabel
719 labelType (CaseLabel _ _) = CodeLabel
720 labelType (PlainModuleInitLabel _) = CodeLabel
721 labelType (LargeSRTLabel _) = DataLabel
722 labelType (LargeBitmapLabel _) = DataLabel
723 labelType (ForeignLabel _ _ _ IsFunction) = CodeLabel
724 labelType (IdLabel _ _ info) = idInfoLabelType info
725 labelType _ = DataLabel
726
727 idInfoLabelType info =
728 case info of
729 InfoTable _ -> DataLabel
730 Closure -> GcPtrLabel
731 ConInfoTable -> DataLabel
732 StaticInfoTable -> DataLabel
733 ClosureTable -> DataLabel
734 RednCounts -> DataLabel
735 _ -> CodeLabel
736
737
738 -- -----------------------------------------------------------------------------
739 -- Does a CLabel need dynamic linkage?
740
741 -- When referring to data in code, we need to know whether
742 -- that data resides in a DLL or not. [Win32 only.]
743 -- @labelDynamic@ returns @True@ if the label is located
744 -- in a DLL, be it a data reference or not.
745
746 labelDynamic :: PackageId -> CLabel -> Bool
747 labelDynamic this_pkg lbl =
748 case lbl of
749 -- is the RTS in a DLL or not?
750 RtsLabel _ -> not opt_Static && (this_pkg /= rtsPackageId)
751
752 IdLabel n _ k -> isDllName this_pkg n
753
754 #if mingw32_TARGET_OS
755 -- When compiling in the "dyn" way, eack package is to be linked into its own shared library.
756 CmmLabel pkg _ _
757 -> not opt_Static && (this_pkg /= pkg)
758
759 -- Foreign label is in some un-named foreign package (or DLL)
760 ForeignLabel _ _ ForeignLabelInExternalPackage _ -> True
761
762 -- Foreign label is linked into the same package as the source file currently being compiled.
763 ForeignLabel _ _ ForeignLabelInThisPackage _ -> False
764
765 -- Foreign label is in some named package.
766 -- When compiling in the "dyn" way, each package is to be linked into its own DLL.
767 ForeignLabel _ _ (ForeignLabelInPackage pkgId) _
768 -> (not opt_Static) && (this_pkg /= pkgId)
769
770 #else
771 -- On Mac OS X and on ELF platforms, false positives are OK,
772 -- so we claim that all foreign imports come from dynamic libraries
773 ForeignLabel _ _ _ _ -> True
774
775 CmmLabel pkg _ _ -> True
776
777 #endif
778 PlainModuleInitLabel m -> not opt_Static && this_pkg /= (modulePackageId m)
779
780 -- Note that DynamicLinkerLabels do NOT require dynamic linking themselves.
781 _ -> False
782
783 {-
784 OLD?: These GRAN functions are needed for spitting out GRAN_FETCH() at the
785 right places. It is used to detect when the abstractC statement of an
786 CCodeBlock actually contains the code for a slow entry point. -- HWL
787
788 We need at least @Eq@ for @CLabels@, because we want to avoid
789 duplicate declarations in generating C (see @labelSeenTE@ in
790 @PprAbsC@).
791 -}
792
793 -----------------------------------------------------------------------------
794 -- Printing out CLabels.
795
796 {-
797 Convention:
798
799 <name>_<type>
800
801 where <name> is <Module>_<name> for external names and <unique> for
802 internal names. <type> is one of the following:
803
804 info Info table
805 srt Static reference table
806 srtd Static reference table descriptor
807 entry Entry code (function, closure)
808 slow Slow entry code (if any)
809 ret Direct return address
810 vtbl Vector table
811 <n>_alt Case alternative (tag n)
812 dflt Default case alternative
813 btm Large bitmap vector
814 closure Static closure
815 con_entry Dynamic Constructor entry code
816 con_info Dynamic Constructor info table
817 static_entry Static Constructor entry code
818 static_info Static Constructor info table
819 sel_info Selector info table
820 sel_entry Selector entry code
821 cc Cost centre
822 ccs Cost centre stack
823
824 Many of these distinctions are only for documentation reasons. For
825 example, _ret is only distinguished from _entry to make it easy to
826 tell whether a code fragment is a return point or a closure/function
827 entry.
828
829 Note [Closure and info labels]
830 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
831 For a function 'foo, we have:
832 foo_info : Points to the info table describing foo's closure
833 (and entry code for foo with tables next to code)
834 foo_closure : Static (no-free-var) closure only:
835 points to the statically-allocated closure
836
837 For a data constructor (such as Just or Nothing), we have:
838 Just_con_info: Info table for the data constructor itself
839 the first word of a heap-allocated Just
840 Just_info: Info table for the *worker function*, an
841 ordinary Haskell function of arity 1 that
842 allocates a (Just x) box:
843 Just = \x -> Just x
844 Just_closure: The closure for this worker
845
846 Nothing_closure: a statically allocated closure for Nothing
847 Nothing_static_info: info table for Nothing_closure
848
849 All these must be exported symbol, EXCEPT Just_info. We don't need to
850 export this because in other modules we either have
851 * A reference to 'Just'; use Just_closure
852 * A saturated call 'Just x'; allocate using Just_con_info
853 Not exporting these Just_info labels reduces the number of symbols
854 somewhat.
855 -}
856
857 instance Outputable CLabel where
858 ppr = pprCLabel
859 instance PlatformOutputable CLabel where
860 pprPlatform _ = pprCLabel
861
862 pprCLabel :: CLabel -> SDoc
863
864 pprCLabel (AsmTempLabel u)
865 | cGhcWithNativeCodeGen == "YES"
866 = getPprStyle $ \ sty ->
867 if asmStyle sty then
868 ptext asmTempLabelPrefix <> pprUnique u
869 else
870 char '_' <> pprUnique u
871
872 pprCLabel (DynamicLinkerLabel info lbl)
873 | cGhcWithNativeCodeGen == "YES"
874 = pprDynamicLinkerAsmLabel info lbl
875
876 pprCLabel PicBaseLabel
877 | cGhcWithNativeCodeGen == "YES"
878 = ptext (sLit "1b")
879
880 pprCLabel (DeadStripPreventer lbl)
881 | cGhcWithNativeCodeGen == "YES"
882 = pprCLabel lbl <> ptext (sLit "_dsp")
883
884 pprCLabel lbl
885 = getPprStyle $ \ sty ->
886 if cGhcWithNativeCodeGen == "YES" && asmStyle sty
887 then maybe_underscore (pprAsmCLbl lbl)
888 else pprCLbl lbl
889
890 maybe_underscore doc
891 | underscorePrefix = pp_cSEP <> doc
892 | otherwise = doc
893
894 #ifdef mingw32_TARGET_OS
895 -- In asm mode, we need to put the suffix on a stdcall ForeignLabel.
896 -- (The C compiler does this itself).
897 pprAsmCLbl (ForeignLabel fs (Just sz) _ _)
898 = ftext fs <> char '@' <> int sz
899 #endif
900 pprAsmCLbl lbl
901 = pprCLbl lbl
902
903 pprCLbl (StringLitLabel u)
904 = pprUnique u <> ptext (sLit "_str")
905
906 pprCLbl (CaseLabel u CaseReturnPt)
907 = hcat [pprUnique u, ptext (sLit "_ret")]
908 pprCLbl (CaseLabel u CaseReturnInfo)
909 = hcat [pprUnique u, ptext (sLit "_info")]
910 pprCLbl (CaseLabel u (CaseAlt tag))
911 = hcat [pprUnique u, pp_cSEP, int tag, ptext (sLit "_alt")]
912 pprCLbl (CaseLabel u CaseDefault)
913 = hcat [pprUnique u, ptext (sLit "_dflt")]
914
915 pprCLbl (LargeSRTLabel u) = pprUnique u <> pp_cSEP <> ptext (sLit "srtd")
916 pprCLbl (LargeBitmapLabel u) = text "b" <> pprUnique u <> pp_cSEP <> ptext (sLit "btm")
917 -- Some bitsmaps for tuple constructors have a numeric tag (e.g. '7')
918 -- until that gets resolved we'll just force them to start
919 -- with a letter so the label will be legal assmbly code.
920
921
922 pprCLbl (CmmLabel _ str CmmCode) = ftext str
923 pprCLbl (CmmLabel _ str CmmData) = ftext str
924 pprCLbl (CmmLabel _ str CmmGcPtr) = ftext str
925 pprCLbl (CmmLabel _ str CmmPrimCall) = ftext str
926
927 pprCLbl (RtsLabel (RtsApFast str)) = ftext str <> ptext (sLit "_fast")
928
929 pprCLbl (RtsLabel (RtsSelectorInfoTable upd_reqd offset))
930 = hcat [ptext (sLit "stg_sel_"), text (show offset),
931 ptext (if upd_reqd
932 then (sLit "_upd_info")
933 else (sLit "_noupd_info"))
934 ]
935
936 pprCLbl (RtsLabel (RtsSelectorEntry upd_reqd offset))
937 = hcat [ptext (sLit "stg_sel_"), text (show offset),
938 ptext (if upd_reqd
939 then (sLit "_upd_entry")
940 else (sLit "_noupd_entry"))
941 ]
942
943 pprCLbl (RtsLabel (RtsApInfoTable upd_reqd arity))
944 = hcat [ptext (sLit "stg_ap_"), text (show arity),
945 ptext (if upd_reqd
946 then (sLit "_upd_info")
947 else (sLit "_noupd_info"))
948 ]
949
950 pprCLbl (RtsLabel (RtsApEntry upd_reqd arity))
951 = hcat [ptext (sLit "stg_ap_"), text (show arity),
952 ptext (if upd_reqd
953 then (sLit "_upd_entry")
954 else (sLit "_noupd_entry"))
955 ]
956
957 pprCLbl (CmmLabel _ fs CmmInfo)
958 = ftext fs <> ptext (sLit "_info")
959
960 pprCLbl (CmmLabel _ fs CmmEntry)
961 = ftext fs <> ptext (sLit "_entry")
962
963 pprCLbl (CmmLabel _ fs CmmRetInfo)
964 = ftext fs <> ptext (sLit "_info")
965
966 pprCLbl (CmmLabel _ fs CmmRet)
967 = ftext fs <> ptext (sLit "_ret")
968
969 pprCLbl (RtsLabel (RtsPrimOp primop))
970 = ptext (sLit "stg_") <> ppr primop
971
972 pprCLbl (RtsLabel (RtsSlowTickyCtr pat))
973 = ptext (sLit "SLOW_CALL_") <> text pat <> ptext (sLit "_ctr")
974
975 pprCLbl (ForeignLabel str _ _ _)
976 = ftext str
977
978 pprCLbl (IdLabel name cafs flavor) = ppr name <> ppIdFlavor flavor
979
980 pprCLbl (CC_Label cc) = ppr cc
981 pprCLbl (CCS_Label ccs) = ppr ccs
982
983 pprCLbl (PlainModuleInitLabel mod)
984 = ptext (sLit "__stginit_") <> ppr mod
985
986 pprCLbl (HpcTicksLabel mod)
987 = ptext (sLit "_hpc_tickboxes_") <> ppr mod <> ptext (sLit "_hpc")
988
989 ppIdFlavor :: IdLabelInfo -> SDoc
990 ppIdFlavor x = pp_cSEP <>
991 (case x of
992 Closure -> ptext (sLit "closure")
993 SRT -> ptext (sLit "srt")
994 InfoTable _ -> ptext (sLit "info")
995 Entry -> ptext (sLit "entry")
996 Slow -> ptext (sLit "slow")
997 RednCounts -> ptext (sLit "ct")
998 ConEntry -> ptext (sLit "con_entry")
999 ConInfoTable -> ptext (sLit "con_info")
1000 StaticConEntry -> ptext (sLit "static_entry")
1001 StaticInfoTable -> ptext (sLit "static_info")
1002 ClosureTable -> ptext (sLit "closure_tbl")
1003 )
1004
1005
1006 pp_cSEP = char '_'
1007
1008
1009 instance Outputable ForeignLabelSource where
1010 ppr fs
1011 = case fs of
1012 ForeignLabelInPackage pkgId -> parens $ text "package: " <> ppr pkgId
1013 ForeignLabelInThisPackage -> parens $ text "this package"
1014 ForeignLabelInExternalPackage -> parens $ text "external package"
1015
1016 -- -----------------------------------------------------------------------------
1017 -- Machine-dependent knowledge about labels.
1018
1019 underscorePrefix :: Bool -- leading underscore on assembler labels?
1020 underscorePrefix = (cLeadingUnderscore == "YES")
1021
1022 asmTempLabelPrefix :: LitString -- for formatting labels
1023 asmTempLabelPrefix =
1024 #if alpha_TARGET_OS
1025 {- The alpha assembler likes temporary labels to look like $L123
1026 instead of L123. (Don't toss the L, because then Lf28
1027 turns into $f28.)
1028 -}
1029 (sLit "$")
1030 #elif darwin_TARGET_OS
1031 (sLit "L")
1032 #else
1033 (sLit ".L")
1034 #endif
1035
1036 pprDynamicLinkerAsmLabel :: DynamicLinkerLabelInfo -> CLabel -> SDoc
1037
1038 #if x86_64_TARGET_ARCH && darwin_TARGET_OS
1039 pprDynamicLinkerAsmLabel CodeStub lbl
1040 = char 'L' <> pprCLabel lbl <> text "$stub"
1041 pprDynamicLinkerAsmLabel SymbolPtr lbl
1042 = char 'L' <> pprCLabel lbl <> text "$non_lazy_ptr"
1043 pprDynamicLinkerAsmLabel GotSymbolPtr lbl
1044 = pprCLabel lbl <> text "@GOTPCREL"
1045 pprDynamicLinkerAsmLabel GotSymbolOffset lbl
1046 = pprCLabel lbl
1047 pprDynamicLinkerAsmLabel _ _
1048 = panic "pprDynamicLinkerAsmLabel"
1049
1050 #elif darwin_TARGET_OS
1051 pprDynamicLinkerAsmLabel CodeStub lbl
1052 = char 'L' <> pprCLabel lbl <> text "$stub"
1053 pprDynamicLinkerAsmLabel SymbolPtr lbl
1054 = char 'L' <> pprCLabel lbl <> text "$non_lazy_ptr"
1055 pprDynamicLinkerAsmLabel _ _
1056 = panic "pprDynamicLinkerAsmLabel"
1057
1058 #elif powerpc_TARGET_ARCH && elf_OBJ_FORMAT
1059 pprDynamicLinkerAsmLabel CodeStub lbl
1060 = pprCLabel lbl <> text "@plt"
1061 pprDynamicLinkerAsmLabel SymbolPtr lbl
1062 = text ".LC_" <> pprCLabel lbl
1063 pprDynamicLinkerAsmLabel _ _
1064 = panic "pprDynamicLinkerAsmLabel"
1065
1066 #elif x86_64_TARGET_ARCH && elf_OBJ_FORMAT
1067 pprDynamicLinkerAsmLabel CodeStub lbl
1068 = pprCLabel lbl <> text "@plt"
1069 pprDynamicLinkerAsmLabel GotSymbolPtr lbl
1070 = pprCLabel lbl <> text "@gotpcrel"
1071 pprDynamicLinkerAsmLabel GotSymbolOffset lbl
1072 = pprCLabel lbl
1073 pprDynamicLinkerAsmLabel SymbolPtr lbl
1074 = text ".LC_" <> pprCLabel lbl
1075
1076 #elif elf_OBJ_FORMAT
1077 pprDynamicLinkerAsmLabel CodeStub lbl
1078 = pprCLabel lbl <> text "@plt"
1079 pprDynamicLinkerAsmLabel SymbolPtr lbl
1080 = text ".LC_" <> pprCLabel lbl
1081 pprDynamicLinkerAsmLabel GotSymbolPtr lbl
1082 = pprCLabel lbl <> text "@got"
1083 pprDynamicLinkerAsmLabel GotSymbolOffset lbl
1084 = pprCLabel lbl <> text "@gotoff"
1085
1086 #elif mingw32_TARGET_OS
1087 pprDynamicLinkerAsmLabel SymbolPtr lbl
1088 = text "__imp_" <> pprCLabel lbl
1089 pprDynamicLinkerAsmLabel _ _
1090 = panic "pprDynamicLinkerAsmLabel"
1091
1092 #else
1093 pprDynamicLinkerAsmLabel _ _
1094 = panic "pprDynamicLinkerAsmLabel"
1095 #endif