summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmParse.y
diff options
context:
space:
mode:
authorBen.Lippmeier@anu.edu.au <unknown>2010-01-02 05:37:54 +0000
committerBen.Lippmeier@anu.edu.au <unknown>2010-01-02 05:37:54 +0000
commit7854ec4b11e117f8514553890851d14a66690fbb (patch)
treef96e7dd94f39eda39fe86da0298e3f628a35ef65 /compiler/cmm/CmmParse.y
parente5fba2f55f560b41e27047bf59958729d51aca84 (diff)
downloadhaskell-7854ec4b11e117f8514553890851d14a66690fbb.tar.gz
Tag ForeignCalls with the package they correspond to
Diffstat (limited to 'compiler/cmm/CmmParse.y')
-rw-r--r--compiler/cmm/CmmParse.y17
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index ff6358da31..0ae88e2336 100644
--- a/compiler/cmm/CmmParse.y
+++ b/compiler/cmm/CmmParse.y
@@ -214,7 +214,7 @@ static :: { ExtFCode [CmmStatic] }
| 'CLOSURE' '(' NAME lits ')'
{ do lits <- sequence $4;
return $ map CmmStaticLit $
- mkStaticClosure (mkForeignLabel $3 Nothing True IsData)
+ mkStaticClosure (mkForeignLabel $3 Nothing ForeignLabelInExternalPackage IsData)
-- mkForeignLabel because these are only used
-- for CHARLIKE and INTLIKE closures in the RTS.
dontCareCCS (map getLit lits) [] [] [] }
@@ -346,14 +346,21 @@ decl :: { ExtCode }
-- an imported function name, with optional packageId
importNames
- :: { [(Maybe PackageId, FastString)] }
+ :: { [(FastString, CLabel)] }
: importName { [$1] }
| importName ',' importNames { $1 : $3 }
importName
- :: { (Maybe PackageId, FastString) }
- : NAME { (Nothing, $1) }
- | STRING NAME { (Just (fsToPackageId (mkFastString $1)), $2) }
+ :: { (FastString, CLabel) }
+
+ -- A label imported without an explicit packageId.
+ -- These are taken to come frome some foreign, unnamed package.
+ : NAME
+ { ($1, mkForeignLabel $1 Nothing ForeignLabelInExternalPackage IsFunction) }
+
+ -- A label imported with an explicit packageId.
+ | STRING NAME
+ { ($2, mkCmmCodeLabel (fsToPackageId (mkFastString $1)) $2) }
names :: { [FastString] }