From f7cf8ac4b7f7927836d52a77795693445bfe293b Mon Sep 17 00:00:00 2001 From: Gabor Greif <ggreif@gmail.com> Date: Thu, 20 Dec 2018 18:33:12 +0100 Subject: [PATCH] review feedback --- compiler/cmm/CLabel.hs | 4 ++-- compiler/llvmGen/LlvmCodeGen/Data.hs | 5 +++-- compiler/nativeGen/PPC/Ppr.hs | 5 +++-- compiler/nativeGen/SPARC/Ppr.hs | 5 +++-- compiler/nativeGen/X86/Ppr.hs | 5 +++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 1e5e6e959c..1de6c6dcae 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -1449,11 +1449,11 @@ isAliasToLocalOrIntoThisModule alias lab = thismod == mod | Just nam <- hasHaskellName lab - , staticClosureLabel || pprTrace "isAliasToLocal?" (ppr lab) False + , staticClosureLabel , isInternalName nam = True - | otherwise = pprTrace "isAliasToLocal" (ppr alias <+> ppr lab) False + | otherwise = False where staticClosureLabel = isStaticClosureLabel lab diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs index c90b3384d6..a9369729bc 100644 --- a/compiler/llvmGen/LlvmCodeGen/Data.hs +++ b/compiler/llvmGen/LlvmCodeGen/Data.hs @@ -22,6 +22,7 @@ import Platform import FastString import Outputable +import Util ( debugIsOn ) -- ---------------------------------------------------------------------------- -- * Constants @@ -43,8 +44,8 @@ linkage lbl = if externallyVisibleCLabel lbl -- | Pass a CmmStatic section to an equivalent Llvm code. genLlvmData :: (Section, CmmStatics) -> LlvmM LlvmData -- See note [emit-time elimination of static indirections] -genLlvmData (_, Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _]) - | lbl == mkIndStaticInfoLabel +genLlvmData (_, Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, a, b]) + | ASSERT( (a,b) == (0,0) ) lbl == mkIndStaticInfoLabel , let labelInd (CmmLabelOff l _) = Just l labelInd (CmmLabel l) = Just l labelInd _ = Nothing diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 333874dfd0..5e714dfed1 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -34,6 +34,7 @@ import Platform import FastString import Outputable import DynFlags +import Util ( debugIsOn ) import Data.Word import Data.Int @@ -124,8 +125,8 @@ pprBasicBlock info_env (BasicBlock blockid instrs) pprDatas :: CmmStatics -> SDoc -- See note [emit-time elimination of static indirections] -pprDatas (Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _]) - | lbl == mkIndStaticInfoLabel +pprDatas (Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, a, b]) + | ASSERT( (a,b) == (0,0) ) lbl == mkIndStaticInfoLabel , let labelInd (CmmLabelOff l _) = Just l labelInd (CmmLabel l) = Just l labelInd _ = Nothing diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs index 3861468c4c..dc24d00113 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/nativeGen/SPARC/Ppr.hs @@ -50,6 +50,7 @@ import Outputable import Platform import FastString import Data.Word +import Util ( debugIsOn ) -- ----------------------------------------------------------------------------- -- Printing this stuff out @@ -107,8 +108,8 @@ pprBasicBlock info_env (BasicBlock blockid instrs) pprDatas :: CmmStatics -> SDoc -- See note [emit-time elimination of static indirections] -pprDatas (Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _]) - | lbl == mkIndStaticInfoLabel +pprDatas (Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, a, b]) + | ASSERT( (a,b) == (0,0) ) lbl == mkIndStaticInfoLabel , let labelInd (CmmLabelOff l _) = Just l labelInd (CmmLabel l) = Just l labelInd _ = Nothing diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 71675adb2a..8b9e001ab1 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -45,6 +45,7 @@ import Unique ( pprUniqueAlways ) import Platform import FastString import Outputable +import Util ( debugIsOn ) import Data.Word @@ -154,8 +155,8 @@ pprBasicBlock info_env (BasicBlock blockid instrs) pprDatas :: (Alignment, CmmStatics) -> SDoc -- See note [emit-time elimination of static indirections] -pprDatas (_, Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _]) - | lbl == mkIndStaticInfoLabel +pprDatas (_, Statics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, a, b]) + | ASSERT( (a,b) == (0,0) ) lbl == mkIndStaticInfoLabel , let labelInd (CmmLabelOff l _) = Just l labelInd (CmmLabel l) = Just l labelInd _ = Nothing -- GitLab