X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FLiteral.lhs;fp=ghc%2Fcompiler%2FbasicTypes%2FLiteral.lhs;h=b8e28d851132902d1983a7ee2ffd199d7e1f4fc3;hb=5b7c931a5d2fba99d30873b458ec6686e59c07bf;hp=f2d09f37334b2017848dc6af92255f7a1b6a5c46;hpb=d5aa9c5d7591744d112af1c921564dde16e292f5;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/Literal.lhs b/ghc/compiler/basicTypes/Literal.lhs index f2d09f3..b8e28d8 100644 --- a/ghc/compiler/basicTypes/Literal.lhs +++ b/ghc/compiler/basicTypes/Literal.lhs @@ -8,7 +8,8 @@ module Literal ( Literal(..) -- Exported to ParseIface , mkMachInt, mkMachWord , mkMachInt64, mkMachWord64 - , isLitLitLit, maybeLitLit, litSize, litIsDupable, + , isLitLitLit, maybeLitLit, litSize + , litIsDupable, litIsTrivial , literalType, literalPrimRep , hashLiteral @@ -282,9 +283,17 @@ isLitLitLit _ = False maybeLitLit (MachLitLit s t) = Just (s,t) maybeLitLit _ = Nothing +litIsTrivial :: Literal -> Bool +-- True if there is absolutely no penalty to duplicating the literal +-- c.f. CoreUtils.exprIsTrivial +-- False principally of strings +litIsTrivial (MachStr _) = False +litIsTrivial other = True + litIsDupable :: Literal -> Bool - -- True if code space does not go bad if we duplicate this literal - -- False principally of strings +-- True if code space does not go bad if we duplicate this literal +-- c.f. CoreUtils.exprIsDupable +-- Currently we treat it just like litIsTrivial litIsDupable (MachStr _) = False litIsDupable other = True