summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm.hs
diff options
context:
space:
mode:
authorHécate <hecate+gitlab@glitchbra.in>2020-10-10 21:15:36 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-01 01:11:09 -0400
commitdfd27445308d1ed2df8826c2a045130e918e8192 (patch)
tree99fc01edeebc2924ddb7533864e0d4ca18cfe800 /compiler/GHC/CmmToAsm.hs
parentbd4abdc953427e084e7ecba89db64860f6859822 (diff)
downloadhaskell-dfd27445308d1ed2df8826c2a045130e918e8192.tar.gz
Add the proper HLint rules and remove redundant keywords from compiler
Diffstat (limited to 'compiler/GHC/CmmToAsm.hs')
-rw-r--r--compiler/GHC/CmmToAsm.hs32
1 files changed, 15 insertions, 17 deletions
diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs
index 7112d603b6..09ff24e96f 100644
--- a/compiler/GHC/CmmToAsm.hs
+++ b/compiler/GHC/CmmToAsm.hs
@@ -1101,30 +1101,28 @@ cmmExprNative referenceKind expr = do
arch = platformArch platform
case expr of
CmmLoad addr rep
- -> do addr' <- cmmExprNative DataReference addr
- return $ CmmLoad addr' rep
+ -> do addr' <- cmmExprNative DataReference addr
+ return $ CmmLoad addr' rep
CmmMachOp mop args
- -> do args' <- mapM (cmmExprNative DataReference) args
- return $ CmmMachOp mop args'
+ -> do args' <- mapM (cmmExprNative DataReference) args
+ return $ CmmMachOp mop args'
CmmLit (CmmBlock id)
- -> cmmExprNative referenceKind (CmmLit (CmmLabel (infoTblLbl id)))
- -- we must convert block Ids to CLabels here, because we
- -- might have to do the PIC transformation. Hence we must
- -- not modify BlockIds beyond this point.
+ -> cmmExprNative referenceKind (CmmLit (CmmLabel (infoTblLbl id)))
+ -- we must convert block Ids to CLabels here, because we
+ -- might have to do the PIC transformation. Hence we must
+ -- not modify BlockIds beyond this point.
CmmLit (CmmLabel lbl)
- -> do
- cmmMakeDynamicReference config referenceKind lbl
+ -> cmmMakeDynamicReference config referenceKind lbl
CmmLit (CmmLabelOff lbl off)
- -> do
- dynRef <- cmmMakeDynamicReference config referenceKind lbl
- -- need to optimize here, since it's late
- return $ cmmMachOpFold platform (MO_Add (wordWidth platform)) [
- dynRef,
- (CmmLit $ CmmInt (fromIntegral off) (wordWidth platform))
- ]
+ -> do dynRef <- cmmMakeDynamicReference config referenceKind lbl
+ -- need to optimize here, since it's late
+ return $ cmmMachOpFold platform (MO_Add (wordWidth platform)) [
+ dynRef,
+ (CmmLit $ CmmInt (fromIntegral off) (wordWidth platform))
+ ]
-- On powerpc (non-PIC), it's easier to jump directly to a label than
-- to use the register table, so we replace these registers