X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fgenapply%2FGenApply.hs;h=b7cc6dd53c2a69a0962c8f3ee6754208db6a41b8;hp=1a0314052163528e5688015b403ab2c348bc2dec;hb=d31dfb32ea936c22628b508c28a36c12e631430a;hpb=c9c4951cc1d76273be541fc4791e131e418956aa diff --git a/utils/genapply/GenApply.hs b/utils/genapply/GenApply.hs index 1a03140..b7cc6dd 100644 --- a/utils/genapply/GenApply.hs +++ b/utils/genapply/GenApply.hs @@ -336,6 +336,18 @@ genMkPAP regstatus macro jump ticker disamb -- generate an apply function -- args is a list of 'p', 'n', 'f', 'd' or 'l' +formalParam :: ArgRep -> Int -> Doc +formalParam V _ = empty +formalParam arg n = + formalParamType arg <> space <> + text "arg" <> int n <> text ", " +formalParamType arg | isPtr arg = text "\"ptr\"" <> space <> argRep arg + | otherwise = argRep arg + +argRep F = text "F_" +argRep D = text "D_" +argRep L = text "L_" +argRep _ = text "W_" genApply regstatus args = let @@ -345,9 +357,8 @@ genApply regstatus args = in vcat [ text "INFO_TABLE_RET(" <> mkApplyName args <> text ", " <> - int all_args_size <> text "/*framsize*/," <> - int (fromIntegral (mkBitmap args)) <> text "/*bitmap*/, " <> - text "RET_SMALL)\n{", + text "RET_SMALL, " <> (cat $ zipWith formalParam args [1..]) <> + text ")\n{", nest 4 (vcat [ text "W_ info;", text "W_ arity;",