Skip to content

Commit

Permalink
Fix the build for ghc-8.8.2. (haskell/ghcide#335)
Browse files Browse the repository at this point in the history
* Fix the build for ghc-8.8.2.

* Match the single-element list first.

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
  • Loading branch information
robrix and cocreature committed Jan 21, 2020
1 parent 17432ba commit 11f0409
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ghcide/src/Development/IDE/GHC/CPP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import Module
import DynFlags
import Panic
import FileCleanup
#if MIN_GHC_API_VERSION(8,8,0)
#if MIN_GHC_API_VERSION(8,8,2)
import LlvmCodeGen (LlvmVersion, llvmVersionList)
#elif MIN_GHC_API_VERSION(8,8,0)
import LlvmCodeGen (LlvmVersion (..))
#endif

Expand Down Expand Up @@ -139,7 +141,11 @@ getBackendDefs :: DynFlags -> IO [String]
getBackendDefs dflags | hscTarget dflags == HscLlvm = do
llvmVer <- figureLlvmVersion dflags
return $ case llvmVer of
#if MIN_GHC_API_VERSION(8,8,0)
#if MIN_GHC_API_VERSION(8,8,2)
Just v
| [m] <- llvmVersionList v -> [ "-D__GLASGOW_HASKELL_LLVM__=" ++ format (m, 0) ]
| m:n:_ <- llvmVersionList v -> [ "-D__GLASGOW_HASKELL_LLVM__=" ++ format (m, n) ]
#elif MIN_GHC_API_VERSION(8,8,0)
Just (LlvmVersion n) -> [ "-D__GLASGOW_HASKELL_LLVM__=" ++ format (n,0) ]
Just (LlvmVersionOld m n) -> [ "-D__GLASGOW_HASKELL_LLVM__=" ++ format (m,n) ]
#else
Expand Down

0 comments on commit 11f0409

Please sign in to comment.