Tag ForeignCalls with the package they correspond to
[ghc-hetmet.git] / compiler / nativeGen / PIC.hs
index eb233e0..a573b6b 100644 (file)
@@ -64,12 +64,12 @@ import NCGMonad
 
 
 import Cmm
-import CLabel           ( CLabel, pprCLabel,
+import CLabel           ( CLabel, ForeignLabelSource(..), pprCLabel,
                           mkDynamicLinkerLabel, DynamicLinkerLabelInfo(..),
                           dynamicLinkerLabelInfo, mkPicBaseLabel,
                           labelDynamic, externallyVisibleCLabel )
 
-import CLabel           ( mkForeignLabel )
+import CLabel           ( mkForeignLabel, pprDebugCLabel )
 
 
 import StaticFlags     ( opt_PIC, opt_Static )
@@ -83,6 +83,7 @@ import DynFlags
 import FastString
 
 
+
 --------------------------------------------------------------------------------
 -- It gets called by the cmmToCmm pass for every CmmLabel in the Cmm
 -- code. It does The Right Thing(tm) to convert the CmmLabel into a
@@ -110,8 +111,12 @@ cmmMakeDynamicReference
              -> ReferenceKind     -- whether this is the target of a jump
              -> CLabel            -- the label
              -> m CmmExpr
-  
+
 cmmMakeDynamicReference dflags addImport referenceKind lbl
+   = cmmMakeDynamicReference' dflags addImport referenceKind lbl
+
+  
+cmmMakeDynamicReference' dflags addImport referenceKind lbl
   | Just _ <- dynamicLinkerLabelInfo lbl
   = return $ CmmLit $ CmmLabel lbl   -- already processed it, pass through
 
@@ -450,8 +455,10 @@ needImportedSymbols arch os
 -- position-independent code.
 gotLabel :: CLabel
 gotLabel 
-       = mkForeignLabel -- HACK: it's not really foreign
-               (fsLit ".LCTOC1") Nothing False IsData
+       -- HACK: this label isn't really foreign
+       = mkForeignLabel 
+               (fsLit ".LCTOC1") 
+               Nothing ForeignLabelInThisPackage IsData