[commit: ghc] master: LLVM backend: Show expected LLVM version in warnings/errors (0e9a331)
git at git.haskell.org
git at git.haskell.org
Fri Dec 18 17:41:27 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0e9a331f25c89c6150a43d7d5d27ef5cb6e057ec/ghc
>---------------------------------------------------------------
commit 0e9a331f25c89c6150a43d7d5d27ef5cb6e057ec
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Fri Dec 18 12:21:47 2015 -0500
LLVM backend: Show expected LLVM version in warnings/errors
Summary:
Before:
[1 of 1] Compiling Main ( Main.hs, Main.o )
You are using a new version of LLVM that hasn't been tested yet!
We will try though...
After:
[1 of 1] Compiling Main ( Main.hs, Main.o )
You are using an unsupported version of LLVM!
Currently only 3.7 is supported.
We will try though...
Before:
[1 of 1] Compiling Main ( Main.hs, Main.o )
<no location info>:
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM
ghc: could not execute: opt
After:
[1 of 1] Compiling Main ( Main.hs, Main.o )
<no location info>: error:
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM 3.7
ghc-stage1: could not execute: opt
Reviewers: austin, rwbarton, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1658
>---------------------------------------------------------------
0e9a331f25c89c6150a43d7d5d27ef5cb6e057ec
compiler/llvmGen/LlvmCodeGen.hs | 3 +++
compiler/llvmGen/LlvmCodeGen/Base.hs | 5 ++++-
compiler/main/SysTools.hs | 5 ++++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs
index 3453484..3c63aa0 100644
--- a/compiler/llvmGen/LlvmCodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen.hs
@@ -54,6 +54,9 @@ llvmCodeGen dflags h us cmm_stream
let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags
when (ver /= supportedLlvmVersion && doWarn) $
putMsg dflags (text "You are using an unsupported version of LLVM!"
+ $+$ text ("Currently only " ++
+ llvmVersionStr supportedLlvmVersion ++
+ " is supported.")
$+$ text "We will try though...")
-- run code generation
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index 3367cda..82c1eea 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -12,7 +12,7 @@ module LlvmCodeGen.Base (
LiveGlobalRegs,
LlvmUnresData, LlvmData, UnresLabel, UnresStatic,
- LlvmVersion, supportedLlvmVersion,
+ LlvmVersion, supportedLlvmVersion, llvmVersionStr,
LlvmM,
runLlvm, liftStream, withClearVars, varLookup, varInsert,
@@ -184,6 +184,9 @@ type LlvmVersion = (Int, Int)
supportedLlvmVersion :: LlvmVersion
supportedLlvmVersion = sUPPORTED_LLVM_VERSION
+llvmVersionStr :: LlvmVersion -> String
+llvmVersionStr (major, minor) = show major ++ "." ++ show minor
+
-- ----------------------------------------------------------------------------
-- * Environment Handling
--
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index c7ca4a6..4166b9b 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -66,6 +66,8 @@ import Util
import DynFlags
import Exception
+import LlvmCodeGen.Base (llvmVersionStr, supportedLlvmVersion)
+
import Data.IORef
import Control.Monad
import System.Exit
@@ -653,7 +655,8 @@ figureLlvmVersion dflags = do
errorMsg dflags $ vcat
[ text "Warning:", nest 9 $
text "Couldn't figure out LLVM version!" $$
- text "Make sure you have installed LLVM"]
+ text ("Make sure you have installed LLVM " ++
+ llvmVersionStr supportedLlvmVersion) ]
return Nothing)
return ver
More information about the ghc-commits
mailing list