[commit: ghc] master: Delay inlining 'text' so that the RULE has a chance to fire (fabb155)

Simon Peyton Jones simonpj at microsoft.com
Mon Jul 23 13:54:28 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/fabb1551411701338e737c741300bdd47ad11f9c

>---------------------------------------------------------------

commit fabb1551411701338e737c741300bdd47ad11f9c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Jul 23 09:17:33 2012 +0100

    Delay inlining 'text' so that the RULE has a chance to fire

>---------------------------------------------------------------

 compiler/utils/Pretty.lhs |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs
index 5d5dec1..e4f748a 100644
--- a/compiler/utils/Pretty.lhs
+++ b/compiler/utils/Pretty.lhs
@@ -555,7 +555,10 @@ isEmpty Empty = True
 isEmpty _     = False
 
 char  c = textBeside_ (Chr c) (_ILIT(1)) Empty
+
 text  s = case iUnbox (length   s) of {sl -> textBeside_ (Str s)  sl Empty}
+{-# NOINLINE [1] text #-}   -- Give the RULE a chance to fire
+
 ftext :: FastString -> Doc
 ftext s = case iUnbox (lengthFS s) of {sl -> textBeside_ (PStr s) sl Empty}
 ptext :: LitString -> Doc





More information about the Cvs-ghc mailing list