[PATCH] get rid of "Just" string in __GLASGOW_HASKELL_LLVM__ define for invoked GCC The patch fixes invoked GCC command line -D parameter from -D__GLASGOW_HASKELL_LLVM__=Just <LLVM version number> to correct -D__GLASGOW_HASKELL_LLVM__=<LLVM version number>, e.g. -D__GLASGOW_HASKELL_LLVM__=Just 32 fixed to -D__GLASGOW_HASKELL_LLVM__=32 for LLVM 3.2

--- compiler/main/DriverPipeline.hs | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 337778e..f789d44 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -2086,7 +2086,9 @@ doCpp dflags raw input_fn output_fn = do getBackendDefs :: DynFlags -> IO [String] getBackendDefs dflags | hscTarget dflags == HscLlvm = do llvmVer <- figureLlvmVersion dflags - return [ "-D__GLASGOW_HASKELL_LLVM__="++show llvmVer ] + return $ case llvmVer of + Just n -> [ "-D__GLASGOW_HASKELL_LLVM__="++show n ] + _ -> [] getBackendDefs _ = return [] -- 1.7.3.2

Hi Karel,
I merged this earlier. Thanks.
On Mon, Jan 6, 2014 at 5:39 PM, Karel Gardas
--- compiler/main/DriverPipeline.hs | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 337778e..f789d44 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -2086,7 +2086,9 @@ doCpp dflags raw input_fn output_fn = do getBackendDefs :: DynFlags -> IO [String] getBackendDefs dflags | hscTarget dflags == HscLlvm = do llvmVer <- figureLlvmVersion dflags - return [ "-D__GLASGOW_HASKELL_LLVM__="++show llvmVer ] + return $ case llvmVer of + Just n -> [ "-D__GLASGOW_HASKELL_LLVM__="++show n ] + _ -> []
getBackendDefs _ = return [] -- 1.7.3.2
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
-- Regards, Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/
participants (2)
-
Austin Seipp
-
Karel Gardas