diff options
author | mrchebas@gmail.com <unknown> | 2007-01-17 13:32:34 +0000 |
---|---|---|
committer | mrchebas@gmail.com <unknown> | 2007-01-17 13:32:34 +0000 |
commit | 200d2b8bd462a8356e5cf731a99055d4c7461959 (patch) | |
tree | 00d468aff5ab80eee6570e8725c2b8b707b54abe /compiler/cmm/PprCmm.hs | |
parent | 5e2dabea8de9ed9c6064bf8ce1570f5ca5742179 (diff) | |
download | haskell-200d2b8bd462a8356e5cf731a99055d4c7461959.tar.gz |
prettifying Cmm: print MachOps as identifiers by replacing ' ' with '_'
Diffstat (limited to 'compiler/cmm/PprCmm.hs')
-rw-r--r-- | compiler/cmm/PprCmm.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs index 714c80e2d3..cb2adf7dc1 100644 --- a/compiler/cmm/PprCmm.hs +++ b/compiler/cmm/PprCmm.hs @@ -339,7 +339,10 @@ genMachOp mop args || isJust (infixMachOp7 mop) || isJust (infixMachOp8 mop) = parens (pprExpr (CmmMachOp mop args)) - | otherwise = char '%' <> pprMachOp mop <> parens (commafy (map pprExpr args)) + | otherwise = char '%' <> ppr_op <> parens (commafy (map pprExpr args)) + where ppr_op = text (map (\c -> if c == ' ' then '_' else c) + (show mop)) + -- replace spaces in (show mop) with underscores, -- -- Unsigned ops on the word size of the machine get nice symbols. |