[commit: ghc] master: Add has_side_effets to the raise# primop (0957a9b)

git at git.haskell.org git at git.haskell.org
Thu Aug 7 08:55:56 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0957a9b0e3f9723761d12d9684c93209a8056755/ghc

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

commit 0957a9b0e3f9723761d12d9684c93209a8056755
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Aug 7 07:56:28 2014 +0100

    Add has_side_effets to the raise# primop
    
    According to the definition of has_side_effets in PrimOp,
    raise# clearly has side effects!  In practice it makes little
    difference becuase the fact that it returns bottom is more
    important... but still it's better to say it right.


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

0957a9b0e3f9723761d12d9684c93209a8056755
 compiler/prelude/primops.txt.pp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index 4faa585..19cd812 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -1881,6 +1881,11 @@ primop  RaiseOp "raise#" GenPrimOp
    strictness  = { \ _arity -> mkClosedStrictSig [topDmd] botRes }
       -- NB: result is bottom
    out_of_line = True
+   has_side_effects = True
+     -- raise# certainly throws a Haskell exception and hence has_side_effects
+     -- It doesn't actually make much difference because the fact that it
+     -- returns bottom independently ensures that we are careful not to discard
+     -- it.  But still, it's better to say the Right Thing.
 
 -- raiseIO# needs to be a primop, because exceptions in the IO monad
 -- must be *precise* - we don't want the strictness analyser turning



More information about the ghc-commits mailing list