diff options
author | Austin Seipp <mad.one@gmail.com> | 2013-01-13 22:23:37 -0600 |
---|---|---|
committer | Austin Seipp <mad.one@gmail.com> | 2013-01-16 23:47:51 -0600 |
commit | 5cca0b443ed2b0328e58fb7881cb393c300f64ed (patch) | |
tree | 5ca824850231cfe6b657ebd9b28a37fdabff3d42 /compiler/llvmGen | |
parent | b05531bd2d03bf13ddc609bad1fcaf177854a761 (diff) | |
download | haskell-5cca0b443ed2b0328e58fb7881cb393c300f64ed.tar.gz |
Add -f[no-]warn-unsupported-llvm-version. Closes Trac #7579.
This controls whether or not the compiler warns if we're using an LLVM
version that's too old or too new. It's mostly useful when building the
compiler knowingly with an unsupported version, so you don't get a lot
of warnings in the build process.
There's no documentation for this since it's a flag only a few
developers would care about anyway.
Signed-off-by: Austin Seipp <mad.one@gmail.com>
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index 4b8455f2be..04064bb9ac 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -68,11 +68,12 @@ llvmCodeGen dflags h us cmms ver <- (fromMaybe defaultLlvmVersion) `fmap` figureLlvmVersion dflags -- cache llvm version for later use writeIORef (llvmVersion dflags) ver - when (ver < minSupportLlvmVersion) $ + let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags + when (ver < minSupportLlvmVersion && doWarn) $ errorMsg dflags (text "You are using an old version of LLVM that" <> text " isn't supported anymore!" $+$ text "We will try though...") - when (ver > maxSupportLlvmVersion) $ + when (ver > maxSupportLlvmVersion && doWarn) $ putMsg dflags (text "You are using a new version of LLVM that" <> text " hasn't been tested yet!" $+$ text "We will try though...") |