[commit: ghc] master: errorWithoutStackTrace: omit profiling stack trace (#14970) (dc655bf)

git at git.haskell.org git at git.haskell.org
Wed May 2 11:48:58 UTC 2018


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

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

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

commit dc655bf0310012b193cf49cce9f5b0bfbc53764c
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Sat Apr 21 12:22:18 2018 +0100

    errorWithoutStackTrace: omit profiling stack trace (#14970)
    
    Test Plan: validate
    
    Reviewers: hvr, bgamari, erikd
    
    Subscribers: thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4648


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

dc655bf0310012b193cf49cce9f5b0bfbc53764c
 libraries/base/GHC/Err.hs | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libraries/base/GHC/Err.hs b/libraries/base/GHC/Err.hs
index 4231fce..3d64c95 100644
--- a/libraries/base/GHC/Err.hs
+++ b/libraries/base/GHC/Err.hs
@@ -30,7 +30,9 @@ import GHC.Prim
 import GHC.Integer ()   -- Make sure Integer is compiled first
                         -- because GHC depends on it in a wired-in way
                         -- so the build system doesn't see the dependency
-import {-# SOURCE #-} GHC.Exception( errorCallWithCallStackException )
+import {-# SOURCE #-} GHC.Exception
+  ( errorCallWithCallStackException
+  , errorCallException )
 
 -- | 'error' stops execution and displays an error message.
 error :: forall (r :: RuntimeRep). forall (a :: TYPE r).
@@ -46,10 +48,7 @@ error s = raise# (errorCallWithCallStackException s ?callStack)
 -- @since 4.9.0.0
 errorWithoutStackTrace :: forall (r :: RuntimeRep). forall (a :: TYPE r).
                           [Char] -> a
-errorWithoutStackTrace s =
-  -- we don't have withFrozenCallStack yet, so we just inline the definition
-  let ?callStack = freezeCallStack emptyCallStack
-  in error s
+errorWithoutStackTrace s = raise# (errorCallException s)
 
 
 -- Note [Errors in base]



More information about the ghc-commits mailing list