summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-04-06 19:03:42 +0100
committerIan Lynagh <ian@well-typed.com>2013-04-06 19:03:42 +0100
commit8c2f2803e4d76cd8a6e579f55a023d7e132d479b (patch)
treedff2e150e61f0254896faa4a5f6cd6391d00941d
parent93494bdb36fb6cdb910d9600b5512c185db33583 (diff)
parent35a341d4e78078d62ae230f18e5d664f0135e4d1 (diff)
downloadhaskell-8c2f2803e4d76cd8a6e579f55a023d7e132d479b.tar.gz
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
-rw-r--r--compiler/cmm/CmmNode.hs17
-rw-r--r--compiler/cmm/CmmPipeline.hs10
2 files changed, 8 insertions, 19 deletions
diff --git a/compiler/cmm/CmmNode.hs b/compiler/cmm/CmmNode.hs
index b3adefebde..61c0b80179 100644
--- a/compiler/cmm/CmmNode.hs
+++ b/compiler/cmm/CmmNode.hs
@@ -1,6 +1,7 @@
-- CmmNode type for representation using Hoopl graphs.
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
+{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS -fno-warn-tabs #-}
@@ -199,20 +200,8 @@ way is done in cmm/CmmOpt.hs currently. We should fix this!
---------------------------------------------
-- Eq instance of CmmNode
--- It is a shame GHC cannot infer it by itself :(
-
-instance Eq (CmmNode e x) where
- (CmmEntry a) == (CmmEntry a') = a==a'
- (CmmComment a) == (CmmComment a') = a==a'
- (CmmAssign a b) == (CmmAssign a' b') = a==a' && b==b'
- (CmmStore a b) == (CmmStore a' b') = a==a' && b==b'
- (CmmUnsafeForeignCall a b c) == (CmmUnsafeForeignCall a' b' c') = a==a' && b==b' && c==c'
- (CmmBranch a) == (CmmBranch a') = a==a'
- (CmmCondBranch a b c) == (CmmCondBranch a' b' c') = a==a' && b==b' && c==c'
- (CmmSwitch a b) == (CmmSwitch a' b') = a==a' && b==b'
- (CmmCall a b c d e f) == (CmmCall a' b' c' d' e' f') = a==a' && b==b' && c==c' && d==d' && e==e' && f==f'
- (CmmForeignCall a b c d e f) == (CmmForeignCall a' b' c' d' e' f') = a==a' && b==b' && c==c' && d==d' && e==e' && f==f'
- _ == _ = False
+
+deriving instance Eq (CmmNode e x)
----------------------------------------------
-- Hoopl instances of CmmNode
diff --git a/compiler/cmm/CmmPipeline.hs b/compiler/cmm/CmmPipeline.hs
index 78fed222ef..5e9bca30e3 100644
--- a/compiler/cmm/CmmPipeline.hs
+++ b/compiler/cmm/CmmPipeline.hs
@@ -184,11 +184,11 @@ cpsTop hsc_env proc =
|| not (tablesNextToCode dflags)
|| -- Note [inconsistent-pic-reg]
usingInconsistentPicReg
- usingInconsistentPicReg = ( platformArch platform == ArchX86 ||
- platformArch platform == ArchPPC
- )
- && platformOS platform == OSDarwin
- && gopt Opt_PIC dflags
+ usingInconsistentPicReg
+ = case (platformArch platform, platformOS platform, gopt Opt_PIC dflags)
+ of (ArchX86, OSDarwin, pic) -> pic
+ (ArchPPC, OSDarwin, pic) -> pic
+ _ -> False
{- Note [inconsistent-pic-reg]