llvmGen: Really fix build with Clang
authorErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 1 Nov 2015 09:15:24 +0000 (10:15 +0100)
committerBen Gamari <ben@smart-cactus.org>
Sun, 1 Nov 2015 09:15:25 +0000 (10:15 +0100)
Test Plan: Build with Clang and GCC

Reviewers: austin, thomie, hvr, bgamari

Reviewed By: bgamari

Differential Revision: https://phabricator.haskell.org/D1414

compiler/llvmGen/LlvmCodeGen/CodeGen.hs

index cde3276..aa3a0c3 100644 (file)
@@ -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.