diff options
author | Ian Lynagh <igloo@earth.li> | 2008-03-29 14:39:14 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2008-03-29 14:39:14 +0000 |
commit | 9448411acfcaae8109c31be5828e75619f2cad9b (patch) | |
tree | 63ee20f4fd5fcecd00b47ef0a037b77f800843b1 /utils/genprimopcode | |
parent | 493d09b47e4d4faec4f0696d071e3b7f4e7b84ea (diff) | |
download | haskell-9448411acfcaae8109c31be5828e75619f2cad9b.tar.gz |
prelude/PrimOp is now mostly warning-free
commutableOp seems to be unused, so we're no 100% there yet.
Diffstat (limited to 'utils/genprimopcode')
-rw-r--r-- | utils/genprimopcode/Main.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/utils/genprimopcode/Main.hs b/utils/genprimopcode/Main.hs index 3b30742f72..b96e9b4f41 100644 --- a/utils/genprimopcode/Main.hs +++ b/utils/genprimopcode/Main.hs @@ -376,12 +376,14 @@ gen_primop_list (Info _ entries) gen_primop_tag :: Info -> String gen_primop_tag (Info _ entries) - = unlines (max_def : zipWith f primop_entries [1 :: Int ..]) + = unlines (max_def_type : max_def : + tagOf_type : zipWith f primop_entries [1 :: Int ..]) where - primop_entries = filter is_primop entries - f i n = "tagOf_PrimOp " ++ cons i - ++ " = _ILIT(" ++ show n ++ ") :: FastInt" - max_def = "maxPrimOpTag = " ++ show (length primop_entries) ++ " :: Int" + primop_entries = filter is_primop entries + tagOf_type = "tagOf_PrimOp :: PrimOp -> FastInt" + f i n = "tagOf_PrimOp " ++ cons i ++ " = _ILIT(" ++ show n ++ ")" + max_def_type = "maxPrimOpTag :: Int" + max_def = "maxPrimOpTag = " ++ show (length primop_entries) gen_data_decl :: Info -> String gen_data_decl (Info _ entries) |