[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

Karel Gardas karel.gardas at centrum.cz
Mon Jan 6 23:39:31 UTC 2014


---
 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



More information about the ghc-devs mailing list