[project @ 2005-01-28 12:55:17 by simonmar]
[ghc-hetmet.git] / ghc / compiler / cmm / CLabel.hs
index 6f95be9..e732321 100644 (file)
@@ -87,6 +87,7 @@ module CLabel (
         dynamicLinkerLabelInfo,
         
         mkPicBaseLabel,
+        mkDeadStripPreventer,
 
        infoLblToEntryLbl, entryLblToInfoLbl,
        needsCDecl, isAsmTemp, externallyVisibleCLabel,
@@ -97,7 +98,6 @@ module CLabel (
 
 
 #include "HsVersions.h"
-#include "../includes/ghcconfig.h"
 
 import CmdLineOpts      ( DynFlags, opt_Static, opt_DoTickyProfiling )
 import Packages                ( isHomeModule, isDllName )
@@ -197,6 +197,9 @@ data CLabel
                                 -- as 1b, referring to the previous definition
                                 -- of 1: in the assembler source file.
 
+  | DeadStripPreventer CLabel
+    -- label before an info table to prevent excessive dead-stripping on darwin
+
   deriving (Eq, Ord)
 
 data IdLabelInfo
@@ -402,6 +405,9 @@ dynamicLinkerLabelInfo _ = Nothing
 mkPicBaseLabel :: CLabel
 mkPicBaseLabel = PicBaseLabel
 
+mkDeadStripPreventer :: CLabel -> CLabel
+mkDeadStripPreventer lbl = DeadStripPreventer lbl
+
 -- -----------------------------------------------------------------------------
 -- Converting info labels to entry labels.
 
@@ -619,6 +625,9 @@ pprCLabel (DynamicLinkerLabel info lbl)
    
 pprCLabel PicBaseLabel
    = ptext SLIT("1b")
+   
+pprCLabel (DeadStripPreventer lbl)
+   = pprCLabel lbl <> ptext SLIT("_dsp")
 #endif
 
 pprCLabel lbl =