[commit: ghc] master: Use full name of LLVM program in error message (e547954)

git at git.haskell.org git at git.haskell.org
Wed Nov 4 04:20:44 UTC 2015


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

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

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

commit e5479541599eec6237e3a3d784290d76fe01e5bc
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Mon Nov 2 11:45:14 2015 +1100

    Use full name of LLVM program in error message
    
    Previously something like `/usr/bin/opt-3.7` was being shortened to
    `opt-3` using the `takeBaseName` function. This shortened form is
    actually not correct. We should use `takeFileName` instead.
    
    Reviewers: bgamari, austin, hvr
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1420


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

e5479541599eec6237e3a3d784290d76fe01e5bc
 compiler/main/SysTools.hs                 | 2 +-
 testsuite/tests/driver/T8602/T8602.stderr | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 108aba7..5e9646d 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -1329,7 +1329,7 @@ handleProc pgm phase_name proc = do
     case rc of
       ExitSuccess{} -> return r
       ExitFailure n -> throwGhcExceptionIO (
-            ProgramError ("`" ++ takeBaseName pgm ++ "'" ++
+            ProgramError ("`" ++ takeFileName pgm ++ "'" ++
                           " failed in phase `" ++ phase_name ++ "'." ++
                           " (Exit code: " ++ show n ++ ")"))
   where
diff --git a/testsuite/tests/driver/T8602/T8602.stderr b/testsuite/tests/driver/T8602/T8602.stderr
index f3bb7e1..eb28842 100644
--- a/testsuite/tests/driver/T8602/T8602.stderr
+++ b/testsuite/tests/driver/T8602/T8602.stderr
@@ -1,2 +1,2 @@
 A B C
-`t8602' failed in phase `Haskell pre-processor'. (Exit code: 1)
+`t8602.sh' failed in phase `Haskell pre-processor'. (Exit code: 1)



More information about the ghc-commits mailing list