summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CLabel.hs4
-rw-r--r--compiler/cmm/CmmLex.x2
-rw-r--r--compiler/cmm/CmmParse.y17
3 files changed, 13 insertions, 10 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 0f2c0ae7fa..c5afa09d75 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -333,9 +333,9 @@ data CmmLabelInfo
| CmmEntry -- ^ misc rts entry points, suffix _entry
| CmmRetInfo -- ^ misc rts ret info tables, suffix _info
| CmmRet -- ^ misc rts return points, suffix _ret
- | CmmData -- ^ misc rts data bits, eg CHARLIKE_closure
+ | CmmData -- ^ misc rts data bits
| CmmCode -- ^ misc rts code
- | CmmClosure -- ^ closures eg CHARLIKE_closure
+ | CmmClosure -- ^ misc rts closures, suffix _closure
| CmmPrimCall -- ^ a prim call to some hand written Cmm code
deriving (Eq, Ord)
diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x
index f56db7bd4c..dfbb751021 100644
--- a/compiler/cmm/CmmLex.x
+++ b/compiler/cmm/CmmLex.x
@@ -135,6 +135,7 @@ data CmmToken
| CmmT_Ne
| CmmT_BoolAnd
| CmmT_BoolOr
+ | CmmT_ANONYMOUS_CLOSURE
| CmmT_CLOSURE
| CmmT_INFO_TABLE
| CmmT_INFO_TABLE_RET
@@ -218,6 +219,7 @@ name span buf len =
reservedWordsFM = listToUFM $
map (\(x, y) -> (mkFastString x, y)) [
+ ( "ANONYMOUS_CLOSURE", CmmT_ANONYMOUS_CLOSURE ),
( "CLOSURE", CmmT_CLOSURE ),
( "INFO_TABLE", CmmT_INFO_TABLE ),
( "INFO_TABLE_RET", CmmT_INFO_TABLE_RET ),
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index db6cc49927..3bd0053cfc 100644
--- a/compiler/cmm/CmmParse.y
+++ b/compiler/cmm/CmmParse.y
@@ -300,6 +300,7 @@ import Data.Maybe
'||' { L _ (CmmT_BoolOr) }
'CLOSURE' { L _ (CmmT_CLOSURE) }
+ 'ANONYMOUS_CLOSURE'{ L _ (CmmT_ANONYMOUS_CLOSURE) }
'INFO_TABLE' { L _ (CmmT_INFO_TABLE) }
'INFO_TABLE_RET'{ L _ (CmmT_INFO_TABLE_RET) }
'INFO_TABLE_FUN'{ L _ (CmmT_INFO_TABLE_FUN) }
@@ -369,10 +370,10 @@ cmmtop :: { CmmParse () }
: cmmproc { $1 }
| cmmdata { $1 }
| decl { $1 }
- | 'CLOSURE' '(' NAME ',' NAME lits ')' ';'
+ | 'CLOSURE' '(' NAME lits ')' ';'
{% withThisPackage $ \pkg ->
- do lits <- sequence $6;
- staticClosure pkg $3 $5 (map getLit lits) }
+ do lits <- sequence $4;
+ staticClosure pkg $3 (map getLit lits) }
-- The only static closures in the RTS are dummy closures like
-- stg_END_TSO_QUEUE_closure and stg_dummy_ret. We don't need
@@ -411,7 +412,7 @@ static :: { CmmParse [CmmStatic] }
| typenot8 '[' INT ']' ';' { return [CmmUninitialised
(widthInBytes (typeWidth $1) *
fromIntegral $3)] }
- | 'CLOSURE' '(' NAME lits ')'
+ | 'ANONYMOUS_CLOSURE' '(' NAME lits ')'
{ do { lits <- sequence $4
; dflags <- getDynFlags
; return $ map CmmStaticLit $
@@ -1101,11 +1102,11 @@ profilingInfo dflags desc_str ty_str
else ProfilingInfo (stringToWord8s desc_str)
(stringToWord8s ty_str)
-staticClosure :: PackageKey -> FastString -> FastString -> [CmmLit] -> CmmParse ()
-staticClosure pkg cl_label info payload
+staticClosure :: PackageKey -> FastString -> [CmmLit] -> CmmParse ()
+staticClosure pkg label payload
= do dflags <- getDynFlags
- let lits = mkStaticClosure dflags (mkCmmInfoLabel pkg info) dontCareCCS payload [] [] []
- code $ emitStaticClosure (mkCmmDataLabel pkg cl_label) lits
+ let lits = mkStaticClosure dflags (mkCmmInfoLabel pkg label) dontCareCCS payload [] [] []
+ code $ emitStaticClosure (mkCmmClosureLabel pkg label) lits
foreignCall
:: String