[commit: ghc] master: llvmGen: Really fix build with Clang (8fd5cff)

git at git.haskell.org git at git.haskell.org
Sun Nov 1 09:46:49 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8fd5cff6fa1cd943a90f19df87389d10a2cb27d1/ghc

>---------------------------------------------------------------

commit 8fd5cff6fa1cd943a90f19df87389d10a2cb27d1
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sun Nov 1 10:15:24 2015 +0100

    llvmGen: Really fix build with Clang
    
    Test Plan: Build with Clang and GCC
    
    Reviewers: austin, thomie, hvr, bgamari
    
    Reviewed By: bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1414


>---------------------------------------------------------------

8fd5cff6fa1cd943a90f19df87389d10a2cb27d1
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index cde3276..aa3a0c3 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -476,11 +476,12 @@ genCallWithOverflow
   :: ForeignTarget -> Width -> [CmmFormal] -> [CmmActual] -> LlvmM StmtData
 genCallWithOverflow t@(PrimTarget op) w [dstV, dstO] [lhs, rhs] = do
     -- So far this was only tested for the following four CallishMachOps.
-    MASSERT((op `elem`  [ MO_Add2 w
-                        , MO_AddIntC w
-                        , MO_SubIntC w
-                        , MO_SubWordC w
-                        ]))
+    let valid = op `elem`   [ MO_Add2 w
+                            , MO_AddIntC w
+                            , MO_SubIntC w
+                            , MO_SubWordC w
+                            ]
+    MASSERT(valid)
     let width = widthToLlvmInt w
     -- This will do most of the work of generating the call to the intrinsic and
     -- extracting the values from the struct.



More information about the ghc-commits mailing list