[project @ 2000-12-12 13:27:18 by simonmar]
authorsimonmar <unknown>
Tue, 12 Dec 2000 13:27:18 +0000 (13:27 +0000)
committersimonmar <unknown>
Tue, 12 Dec 2000 13:27:18 +0000 (13:27 +0000)
Make the foreign export dynamic helper function "exported", so it
doesn't get thrown away.

ghc/compiler/deSugar/DsForeign.lhs

index 65ddba6..ebc1e6d 100644 (file)
@@ -20,9 +20,10 @@ import HsDecls               ( extNameStatic )
 import CallConv
 import TcHsSyn         ( TypecheckedForeignDecl )
 import CoreUtils       ( exprType, mkInlineMe )
-import Id              ( Id, idType, idName, mkVanillaId, mkSysLocal,
+import Id              ( Id, idType, idName, mkId, mkSysLocal,
                          setInlinePragma )
-import IdInfo          ( neverInlinePrag )
+import IdInfo          ( neverInlinePrag, vanillaIdInfo, IdFlavour(..),
+                         setFlavourInfo )
 import Literal         ( Literal(..) )
 import Module          ( Module, moduleUserString )
 import Name            ( mkGlobalName, nameModule, nameOccName, getOccString, 
@@ -259,7 +260,8 @@ dsFExport fn_id ty mod_name ext_name cconv isDyn
        helper_ty =  mkForAllTys tvs $
                     mkFunTys wrapper_arg_tys io_res_ty
 
-       f_helper_glob = mkVanillaId helper_name helper_ty
+       f_helper_glob = mkId helper_name helper_ty
+                               (vanillaIdInfo `setFlavourInfo` ExportedId)
                      where
                        name                = idName fn_id
                        mod