...
 
Commits (12)
  • Ben Gamari's avatar
    fs: Port fixes from ghc-jailbreak repository · 1674353a
    Ben Gamari authored
    * Override rename, unlink, and remove
    * Factor out wchar conversion
    1674353a
  • Adam Sandberg Eriksson's avatar
    853210f2
  • Adam Sandberg Eriksson's avatar
    2831544a
  • Adam Sandberg Eriksson's avatar
  • Vladislav Zavialov's avatar
    Remove Ord SrcLoc, Ord SrcSpan · 26e8fff3
    Vladislav Zavialov authored
    Before this patch, GHC relied on Ord SrcSpan to identify source elements, by
    using SrcSpan as Map keys:
    
    	blackList :: Map SrcSpan ()      -- compiler/GHC/HsToCore/Coverage.hs
    	instanceMap :: Map SrcSpan Name  -- compiler/GHC/HsToCore/Docs.hs
    
    Firstly, this design is not valid in presence of UnhelpfulSpan, as it
    distinguishes between  UnhelpfulSpan "X"  and  UnhelpfulSpan "Y", but those
    strings are messages for the user, unfit to serve as identifiers for source
    elements.
    
    Secondly, this design made it hard to extend SrcSpan with additional data.
    Recall that the definition of SrcSpan is:
    
    	data SrcSpan =
    	    RealSrcSpan !RealSrcSpan
    	  | UnhelpfulSpan !FastString
    
    Say we want to extend the RealSrcSpan constructor with additional information:
    
    	data SrcSpan =
    	    RealSrcSpan !RealSrcSpan !AdditionalInformation
    	  | UnhelpfulSpan !FastString
    
    	getAdditionalInformation :: SrcSpan -> AdditionalInformation
    	getAdditionalInformation (RealSrcSpan _ a) = a
    
    Now, in order for  Map SrcSpan  to keep working correctly, we must *ignore* additional
    information when comparing SrcSpan values:
    
    	instance Ord SrcSpan where
    	  compare (RealSrcSpan r1 _) (RealSrcSpan r2 _) = compare r1 r2
    	  ...
    
    However, this would violate an important law:
    
    	a == b  therefore  f a == f b
    
    Ignoring  AdditionalInformation  in comparisons would mean that with
    f=getAdditionalInformation, the law above does not hold.
    
    A more robust design is to avoid  Ord SrcSpan  altogether, which is what this patch implements.
    The mappings are changed to use RealSrcSpan instead:
    
    	blackList :: Set RealSrcSpan         -- compiler/GHC/HsToCore/Coverage.hs
    	instanceMap :: Map RealSrcSpan Name  -- compiler/GHC/HsToCore/Docs.hs
    
    All SrcSpan comparisons are now done with explicit comparison strategies:
    
    	SrcLoc.leftmost_smallest
    	SrcLoc.leftmost_largest
    	SrcLoc.rightmost_smallest
    
    These strategies are not subject to the law mentioned above and can easily
    discard both the string stored in  UnhelpfulSpan  and  AdditionalInformation.
    
    Updates haddock submodule.
    26e8fff3
  • Ben Gamari's avatar
    users-guide: Shuffle text · 5aa6c188
    Ben Gamari authored
    5aa6c188
  • Ben Gamari's avatar
    users-guide: Drop old release notes · e3f17413
    Ben Gamari authored
    e3f17413
  • Ben Gamari's avatar
    Bump directory submodule to 1.3.6.0 · 84dd9610
    Ben Gamari authored
    84dd9610
  • Stefan Pavikevik's avatar
  • Krzysztof Gogolewski's avatar
    Comments, small refactor · 354e2787
    Krzysztof Gogolewski authored
    * Remove outdated Note [HsForAllTy tyvar binders] and [Context quantification].
      Since the wildcard refactor 1e041b73, HsForAllTy no longer has an flag
      controlling explicity. The field `hsq_implicit` is gone too.
      The current situation is covered by Note [HsType binders] which is already
      linked from LHsQTyVars.
    * Small refactor in CoreLint, extracting common code to a function
    * Remove "not so sure about WpFun" in TcEvidence, per Richard's comment
      ghc/ghc!852 (comment 223226)
    * Use mkIfThenElse in Foreign/Call, as it does exactly what we need.
    354e2787
  • Sylvain Henry's avatar
    Modules: CmmToAsm (#13009) · 1b1067d1
    Sylvain Henry authored
    1b1067d1
  • Shayne Fletcher's avatar
    Derive Ord instance for Extension · 49a07175
    Shayne Fletcher authored
    49a07175
......@@ -969,7 +969,7 @@ doc-tarball:
- validate-x86_64-linux-deb9-debug
- validate-x86_64-windows
variables:
LINUX_BINDIST: "ghc-x86_64-deb9-linux.tar.xz"
LINUX_BINDIST: "ghc-x86_64-deb9-linux-debug.tar.xz"
WINDOWS_BINDIST: "ghc-x86_64-mingw32.tar.xz"
# Due to Windows allow_failure
allow_failure: true
......
......@@ -260,7 +260,7 @@ module GHC (
-- *** Combining and comparing Located values
eqLocated, cmpLocated, combineLocs, addCLoc,
leftmost_smallest, leftmost_largest, rightmost,
leftmost_smallest, leftmost_largest, rightmost_smallest,
spans, isSubspanOf,
-- * Exceptions
......
......@@ -15,7 +15,7 @@
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
module AsmCodeGen (
module GHC.CmmToAsm (
-- * Module entry point
nativeCodeGen
......@@ -32,43 +32,43 @@ module AsmCodeGen (
import GhcPrelude
import qualified X86.CodeGen
import qualified X86.Regs
import qualified X86.Instr
import qualified X86.Ppr
import qualified GHC.CmmToAsm.X86.CodeGen as X86.CodeGen
import qualified GHC.CmmToAsm.X86.Regs as X86.Regs
import qualified GHC.CmmToAsm.X86.Instr as X86.Instr
import qualified GHC.CmmToAsm.X86.Ppr as X86.Ppr
import qualified SPARC.CodeGen
import qualified SPARC.Regs
import qualified SPARC.Instr
import qualified SPARC.Ppr
import qualified SPARC.ShortcutJump
import qualified SPARC.CodeGen.Expand
import qualified GHC.CmmToAsm.SPARC.CodeGen as SPARC.CodeGen
import qualified GHC.CmmToAsm.SPARC.Regs as SPARC.Regs
import qualified GHC.CmmToAsm.SPARC.Instr as SPARC.Instr
import qualified GHC.CmmToAsm.SPARC.Ppr as SPARC.Ppr
import qualified GHC.CmmToAsm.SPARC.ShortcutJump as SPARC.ShortcutJump
import qualified GHC.CmmToAsm.SPARC.CodeGen.Expand as SPARC.CodeGen.Expand
import qualified PPC.CodeGen
import qualified PPC.Regs
import qualified PPC.RegInfo
import qualified PPC.Instr
import qualified PPC.Ppr
import qualified GHC.CmmToAsm.PPC.CodeGen as PPC.CodeGen
import qualified GHC.CmmToAsm.PPC.Regs as PPC.Regs
import qualified GHC.CmmToAsm.PPC.RegInfo as PPC.RegInfo
import qualified GHC.CmmToAsm.PPC.Instr as PPC.Instr
import qualified GHC.CmmToAsm.PPC.Ppr as PPC.Ppr
import RegAlloc.Liveness
import qualified RegAlloc.Linear.Main as Linear
import GHC.CmmToAsm.Reg.Liveness
import qualified GHC.CmmToAsm.Reg.Linear as Linear
import qualified GraphColor as Color
import qualified RegAlloc.Graph.Main as Color
import qualified RegAlloc.Graph.Stats as Color
import qualified RegAlloc.Graph.TrivColorable as Color
import qualified GraphColor as Color
import qualified GHC.CmmToAsm.Reg.Graph as Color
import qualified GHC.CmmToAsm.Reg.Graph.Stats as Color
import qualified GHC.CmmToAsm.Reg.Graph.TrivColorable as Color
import AsmUtils
import TargetReg
import GHC.CmmToAsm.Reg.Target
import GHC.Platform
import BlockLayout
import GHC.CmmToAsm.BlockLayout as BlockLayout
import Config
import Instruction
import PIC
import Reg
import NCGMonad
import CFG
import Dwarf
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.PIC
import GHC.Platform.Reg
import GHC.CmmToAsm.Monad
import GHC.CmmToAsm.CFG
import GHC.CmmToAsm.Dwarf
import GHC.Cmm.DebugBlock
import GHC.Cmm.BlockId
......
......@@ -9,16 +9,16 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
module BlockLayout
module GHC.CmmToAsm.BlockLayout
( sequenceTop )
where
#include "HsVersions.h"
import GhcPrelude
import Instruction
import NCGMonad
import CFG
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.Monad
import GHC.CmmToAsm.CFG
import GHC.Cmm.BlockId
import GHC.Cmm
......
......@@ -10,7 +10,7 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
module CFG
module GHC.CmmToAsm.CFG
( CFG, CfgEdge(..), EdgeInfo(..), EdgeWeight(..)
, TransitionSource(..)
......@@ -61,7 +61,7 @@ import Digraph
import Maybes
import Unique
import qualified Dominators as Dom
import qualified GHC.CmmToAsm.CFG.Dominators as Dom
import Data.IntMap.Strict (IntMap)
import Data.IntSet (IntSet)
......
......@@ -25,7 +25,7 @@
Originally taken from the dom-lt package.
-}
module Dominators (
module GHC.CmmToAsm.CFG.Dominators (
Node,Path,Edge
,Graph,Rooted
,idom,ipdom
......
-- | Generating C symbol names emitted by the compiler.
module CPrim
module GHC.CmmToAsm.CPrim
( atomicReadLabel
, atomicWriteLabel
, atomicRMWLabel
......
module Dwarf (
module GHC.CmmToAsm.Dwarf (
dwarfGen
) where
......@@ -16,8 +16,8 @@ import GHC.Platform
import Unique
import UniqSupply
import Dwarf.Constants
import Dwarf.Types
import GHC.CmmToAsm.Dwarf.Constants
import GHC.CmmToAsm.Dwarf.Types
import Control.Arrow ( first )
import Control.Monad ( mfilter )
......
-- | Constants describing the DWARF format. Most of this simply
-- mirrors /usr/include/dwarf.h.
module Dwarf.Constants where
module GHC.CmmToAsm.Dwarf.Constants where
import GhcPrelude
......@@ -10,8 +10,8 @@ import FastString
import GHC.Platform
import Outputable
import Reg
import X86.Regs
import GHC.Platform.Reg
import GHC.CmmToAsm.X86.Regs
import Data.Word
......
module Dwarf.Types
module GHC.CmmToAsm.Dwarf.Types
( -- * Dwarf information
DwarfInfo(..)
, pprDwarfInfo
......@@ -32,11 +32,11 @@ import FastString
import Outputable
import GHC.Platform
import Unique
import Reg
import GHC.Platform.Reg
import SrcLoc
import Util
import Dwarf.Constants
import GHC.CmmToAsm.Dwarf.Constants
import qualified Data.ByteString as BS
import qualified Control.Monad.Trans.State.Strict as S
......
......@@ -8,7 +8,7 @@
-- to have architecture specific formats, and do the overloading
-- properly. eg SPARC doesn't care about FF80.
--
module Format (
module GHC.CmmToAsm.Format (
Format(..),
intFormat,
floatFormat,
......
module Instruction (
module GHC.CmmToAsm.Instr (
RegUsage(..),
noUsage,
GenBasicBlock(..), blockId,
......@@ -16,7 +16,7 @@ where
import GhcPrelude
import Reg
import GHC.Platform.Reg
import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections
......
......@@ -10,7 +10,7 @@
--
-- -----------------------------------------------------------------------------
module NCGMonad (
module GHC.CmmToAsm.Monad (
NcgImpl(..),
NatM_State(..), mkNatM_State,
......@@ -45,9 +45,9 @@ where
import GhcPrelude
import Reg
import Format
import TargetReg
import GHC.Platform.Reg
import GHC.CmmToAsm.Format
import GHC.CmmToAsm.Reg.Target
import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections
......@@ -63,10 +63,10 @@ import Module
import Control.Monad ( ap )
import Instruction
import GHC.CmmToAsm.Instr
import Outputable (SDoc, pprPanic, ppr)
import GHC.Cmm (RawCmmDecl, RawCmmStatics)
import CFG
import GHC.CmmToAsm.CFG
data NcgImpl statics instr jumpDest = NcgImpl {
cmmTopCodeGen :: RawCmmDecl -> NatM [NatCmmDecl statics instr],
......
......@@ -33,7 +33,7 @@
that wasn't in the original Cmm code (e.g. floating point literals).
-}
module PIC (
module GHC.CmmToAsm.PIC (
cmmMakeDynamicReference,
CmmMakeDynamicReferenceM(..),
ReferenceKind(..),
......@@ -49,15 +49,14 @@ where
import GhcPrelude
import qualified PPC.Instr as PPC
import qualified PPC.Regs as PPC
import qualified X86.Instr as X86
import qualified GHC.CmmToAsm.PPC.Instr as PPC
import qualified GHC.CmmToAsm.PPC.Regs as PPC
import qualified GHC.CmmToAsm.X86.Instr as X86
import GHC.Platform
import Instruction
import Reg
import NCGMonad
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.CmmToAsm.Monad
import GHC.Cmm.Dataflow.Collections
......
......@@ -12,7 +12,7 @@
-- (a) the sectioning, and (b) the type signatures,
-- the structure should not be too overwhelming.
module PPC.CodeGen (
module GHC.CmmToAsm.PPC.CodeGen (
cmmTopCodeGen,
generateJumpTableForInstr,
InstrBlock
......@@ -26,19 +26,21 @@ where
import GhcPrelude
import GHC.Platform.Regs
import PPC.Instr
import PPC.Cond
import PPC.Regs
import CPrim
import NCGMonad ( NatM, getNewRegNat, getNewLabelNat
, getBlockIdNat, getPicBaseNat, getNewRegPairNat
, getPicBaseMaybeNat )
import Instruction
import PIC
import Format
import RegClass
import Reg
import TargetReg
import GHC.CmmToAsm.PPC.Instr
import GHC.CmmToAsm.PPC.Cond
import GHC.CmmToAsm.PPC.Regs
import GHC.CmmToAsm.CPrim
import GHC.CmmToAsm.Monad
( NatM, getNewRegNat, getNewLabelNat
, getBlockIdNat, getPicBaseNat, getNewRegPairNat
, getPicBaseMaybeNat
)
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.PIC
import GHC.CmmToAsm.Format
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GHC.CmmToAsm.Reg.Target
import GHC.Platform
-- Our intermediate code:
......
module PPC.Cond (
module GHC.CmmToAsm.PPC.Cond (
Cond(..),
condNegate,
condUnsigned,
......
......@@ -12,7 +12,7 @@
#include "HsVersions.h"
module PPC.Instr (
module GHC.CmmToAsm.PPC.Instr (
archWordFormat,
RI(..),
Instr(..),
......@@ -26,13 +26,13 @@ where
import GhcPrelude
import PPC.Regs
import PPC.Cond
import Instruction
import Format
import TargetReg
import RegClass
import Reg
import GHC.CmmToAsm.PPC.Regs
import GHC.CmmToAsm.PPC.Cond
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.Format
import GHC.CmmToAsm.Reg.Target
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GHC.Platform.Regs
import GHC.Cmm.BlockId
......@@ -110,8 +110,8 @@ ppc_mkStackAllocInstr' platform amount
allocMoreStack
:: Platform
-> Int
-> NatCmmDecl statics PPC.Instr.Instr
-> UniqSM (NatCmmDecl statics PPC.Instr.Instr, [(BlockId,BlockId)])
-> NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr
-> UniqSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)])
allocMoreStack _ _ top@(CmmData _ _) = return (top,[])
allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do
......
......@@ -7,19 +7,19 @@
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PPC.Ppr (pprNatCmmDecl) where
module GHC.CmmToAsm.PPC.Ppr (pprNatCmmDecl) where
import GhcPrelude
import PPC.Regs
import PPC.Instr
import PPC.Cond
import PprBase
import Instruction
import Format
import Reg
import RegClass
import TargetReg
import GHC.CmmToAsm.PPC.Regs
import GHC.CmmToAsm.PPC.Instr
import GHC.CmmToAsm.PPC.Cond
import GHC.CmmToAsm.Ppr
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.Format
import GHC.Platform.Reg
import GHC.Platform.Reg.Class
import GHC.CmmToAsm.Reg.Target
import GHC.Cmm hiding (topInfoTable)
import GHC.Cmm.Dataflow.Collections
......
......@@ -7,7 +7,7 @@
-- (c) The University of Glasgow 1996-2004
--
-----------------------------------------------------------------------------
module PPC.RegInfo (
module GHC.CmmToAsm.PPC.RegInfo (
JumpDest( DestBlockId ), getJumpDestBlockId,
canShortcut,
shortcutJump,
......@@ -21,7 +21,7 @@ where
import GhcPrelude
import PPC.Instr
import GHC.CmmToAsm.PPC.Instr
import GHC.Cmm.BlockId
import GHC.Cmm
......
......@@ -6,7 +6,7 @@
--
-- -----------------------------------------------------------------------------
module PPC.Regs (
module GHC.CmmToAsm.PPC.Regs (
-- squeeze functions
virtualRegSqueeze,
realRegSqueeze,
......@@ -51,9 +51,9 @@ where
import GhcPrelude
import Reg
import RegClass
import Format
import GHC.Platform.Reg
import GHC.Platform.Reg.Class
import GHC.CmmToAsm.Format
import GHC.Cmm
import GHC.Cmm.CLabel ( CLabel )
......
......@@ -8,7 +8,7 @@
--
-----------------------------------------------------------------------------
module PprBase (
module GHC.CmmToAsm.Ppr (
castFloatToWord8Array,
castDoubleToWord8Array,
floatToBytes,
......
......@@ -2,22 +2,22 @@
{-# LANGUAGE ScopedTypeVariables #-}
-- | Graph coloring register allocator.
module RegAlloc.Graph.Main (
module GHC.CmmToAsm.Reg.Graph (
regAlloc
) where
import GhcPrelude
import qualified GraphColor as Color
import RegAlloc.Liveness
import RegAlloc.Graph.Spill
import RegAlloc.Graph.SpillClean
import RegAlloc.Graph.SpillCost
import RegAlloc.Graph.Stats
import RegAlloc.Graph.TrivColorable
import Instruction
import TargetReg
import RegClass
import Reg
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Reg.Graph.Spill
import GHC.CmmToAsm.Reg.Graph.SpillClean
import GHC.CmmToAsm.Reg.Graph.SpillCost
import GHC.CmmToAsm.Reg.Graph.Stats
import GHC.CmmToAsm.Reg.Graph.TrivColorable
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.Reg.Target
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import Bag
import GHC.Driver.Session
......@@ -27,7 +27,7 @@ import UniqFM
import UniqSet
import UniqSupply
import Util (seqList)
import CFG
import GHC.CmmToAsm.CFG
import Data.Maybe
import Control.Monad
......
......@@ -12,7 +12,7 @@
-- This code is here because we can test the architecture specific code against
-- it.
--
module RegAlloc.Graph.ArchBase (
module GHC.CmmToAsm.Reg.Graph.Base (
RegClass(..),
Reg(..),
RegSub(..),
......
-- | Register coalescing.
module RegAlloc.Graph.Coalesce (
module GHC.CmmToAsm.Reg.Graph.Coalesce (
regCoalesce,
slurpJoinMovs
) where
import GhcPrelude
import RegAlloc.Liveness
import Instruction
import Reg
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.Cmm
import Bag
......
......@@ -2,16 +2,16 @@
-- | When there aren't enough registers to hold all the vregs we have to spill
-- some of those vregs to slots on the stack. This module is used modify the
-- code to use those slots.
module RegAlloc.Graph.Spill (
module GHC.CmmToAsm.Reg.Graph.Spill (
regSpill,
SpillStats(..),
accSpillSL
) where
import GhcPrelude
import RegAlloc.Liveness
import Instruction
import Reg
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.Cmm hiding (RegSet)
import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections
......
......@@ -26,14 +26,14 @@
-- This also works if the reloads in B1\/B2 were spills instead, because
-- spilling %r1 to a slot makes that slot have the same value as %r1.
--
module RegAlloc.Graph.SpillClean (
module GHC.CmmToAsm.Reg.Graph.SpillClean (
cleanSpills
) where
import GhcPrelude
import RegAlloc.Liveness
import Instruction
import Reg
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.Cmm.BlockId
import GHC.Cmm
......
{-# LANGUAGE ScopedTypeVariables, GADTs, BangPatterns #-}
module RegAlloc.Graph.SpillCost (
module GHC.CmmToAsm.Reg.Graph.SpillCost (
SpillCostRecord,
plusSpillCostRecord,
pprSpillCostRecord,
......@@ -15,10 +15,10 @@ module RegAlloc.Graph.SpillCost (
) where
import GhcPrelude
import RegAlloc.Liveness
import Instruction
import RegClass
import Reg
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GraphBase
......@@ -31,7 +31,7 @@ import Digraph (flattenSCCs)
import Outputable
import GHC.Platform
import State
import CFG
import GHC.CmmToAsm.CFG
import Data.List (nub, minimumBy)
import Data.Maybe
......
......@@ -4,7 +4,7 @@
-- | Carries interesting info for debugging / profiling of the
-- graph coloring register allocator.
module RegAlloc.Graph.Stats (
module GHC.CmmToAsm.Reg.Graph.Stats (
RegAllocStats (..),
pprStats,
......@@ -19,14 +19,14 @@ module RegAlloc.Graph.Stats (
import GhcPrelude
import qualified GraphColor as Color
import RegAlloc.Liveness
import RegAlloc.Graph.Spill
import RegAlloc.Graph.SpillCost
import RegAlloc.Graph.TrivColorable
import Instruction
import RegClass
import Reg
import TargetReg
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Reg.Graph.Spill
import GHC.CmmToAsm.Reg.Graph.SpillCost
import GHC.CmmToAsm.Reg.Graph.TrivColorable
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GHC.CmmToAsm.Reg.Target
import Outputable
import UniqFM
......
{-# LANGUAGE CPP #-}
module RegAlloc.Graph.TrivColorable (
module GHC.CmmToAsm.Reg.Graph.TrivColorable (
trivColorable,
)
......@@ -10,8 +10,8 @@ where
import GhcPrelude
import RegClass
import Reg
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GraphBase
......
......@@ -6,7 +6,7 @@
-- See RegArchBase.hs for the reference.
-- See MachRegs.hs for the actual trivColorable function used in GHC.
--
module RegAlloc.Graph.ArchX86 (
module GHC.CmmToAsm.Reg.Graph.X86 (
classOfReg,
regsOfClass,
regName,
......@@ -17,7 +17,7 @@ module RegAlloc.Graph.ArchX86 (
import GhcPrelude
import RegAlloc.Graph.ArchBase (Reg(..), RegSub(..), RegClass(..))
import GHC.CmmToAsm.Reg.Graph.Base (Reg(..), RegSub(..), RegClass(..))
import UniqSet
import qualified Data.Array as A
......
......@@ -95,10 +95,10 @@ The algorithm is roughly:
-}
module RegAlloc.Linear.Main (
module GHC.CmmToAsm.Reg.Linear (
regAlloc,
module RegAlloc.Linear.Base,
module RegAlloc.Linear.Stats
module GHC.CmmToAsm.Reg.Linear.Base,
module GHC.CmmToAsm.Reg.Linear.Stats
) where
#include "HsVersions.h"
......@@ -106,20 +106,20 @@ module RegAlloc.Linear.Main (
import GhcPrelude
import RegAlloc.Linear.State
import RegAlloc.Linear.Base
import RegAlloc.Linear.StackMap
import RegAlloc.Linear.FreeRegs
import RegAlloc.Linear.Stats
import RegAlloc.Linear.JoinToTargets
import qualified RegAlloc.Linear.PPC.FreeRegs as PPC
import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC
import qualified RegAlloc.Linear.X86.FreeRegs as X86
import qualified RegAlloc.Linear.X86_64.FreeRegs as X86_64
import TargetReg
import RegAlloc.Liveness
import Instruction
import Reg
import GHC.CmmToAsm.Reg.Linear.State
import GHC.CmmToAsm.Reg.Linear.Base
import GHC.CmmToAsm.Reg.Linear.StackMap
import GHC.CmmToAsm.Reg.Linear.FreeRegs
import GHC.CmmToAsm.Reg.Linear.Stats
import GHC.CmmToAsm.Reg.Linear.JoinToTargets
import qualified GHC.CmmToAsm.Reg.Linear.PPC as PPC
import qualified GHC.CmmToAsm.Reg.Linear.SPARC as SPARC
import qualified GHC.CmmToAsm.Reg.Linear.X86 as X86
import qualified GHC.CmmToAsm.Reg.Linear.X86_64 as X86_64
import GHC.CmmToAsm.Reg.Target
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections
......
-- | Put common type definitions here to break recursive module dependencies.
module RegAlloc.Linear.Base (
module GHC.CmmToAsm.Reg.Linear.Base (
BlockAssignment,
Loc(..),
......@@ -19,9 +19,9 @@ where
import GhcPrelude
import RegAlloc.Linear.StackMap
import RegAlloc.Liveness
import Reg
import GHC.CmmToAsm.Reg.Linear.StackMap
import GHC.CmmToAsm.Reg.Liveness
import GHC.Platform.Reg
import GHC.Driver.Session
import Outputable
......
{-# LANGUAGE CPP #-}
module RegAlloc.Linear.FreeRegs (
module GHC.CmmToAsm.Reg.Linear.FreeRegs (
FR(..),
maxSpillSlots
)
......@@ -11,8 +11,8 @@ where
import GhcPrelude
import Reg
import RegClass
import GHC.Platform.Reg
import GHC.Platform.Reg.Class
import GHC.Driver.Session
import Panic
......@@ -30,14 +30,14 @@ import GHC.Platform
-- getFreeRegs cls f = filter ( (==cls) . regClass . RealReg ) f
-- allocateReg f r = filter (/= r) f
import qualified RegAlloc.Linear.PPC.FreeRegs as PPC
import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC
import qualified RegAlloc.Linear.X86.FreeRegs as X86
import qualified RegAlloc.Linear.X86_64.FreeRegs as X86_64
import qualified GHC.CmmToAsm.Reg.Linear.PPC as PPC
import qualified GHC.CmmToAsm.Reg.Linear.SPARC as SPARC
import qualified GHC.CmmToAsm.Reg.Linear.X86 as X86
import qualified GHC.CmmToAsm.Reg.Linear.X86_64 as X86_64
import qualified PPC.Instr
import qualified SPARC.Instr
import qualified X86.Instr
import qualified GHC.CmmToAsm.PPC.Instr as PPC.Instr
import qualified GHC.CmmToAsm.SPARC.Instr as SPARC.Instr
import qualified GHC.CmmToAsm.X86.Instr as X86.Instr
class Show freeRegs => FR freeRegs where
frAllocateReg :: Platform -> RealReg -> freeRegs -> freeRegs
......
......@@ -8,16 +8,16 @@
-- stored one. They might be different if spilling has occurred in one
-- branch; so some fixup code will be required to match up the assignments.
--
module RegAlloc.Linear.JoinToTargets (joinToTargets) where
module GHC.CmmToAsm.Reg.Linear.JoinToTargets (joinToTargets) where
import GhcPrelude
import RegAlloc.Linear.State
import RegAlloc.Linear.Base
import RegAlloc.Linear.FreeRegs
import RegAlloc.Liveness
import Instruction
import Reg
import GHC.CmmToAsm.Reg.Linear.State
import GHC.CmmToAsm.Reg.Linear.Base
import GHC.CmmToAsm.Reg.Linear.FreeRegs
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections
......
-- | Free regs map for PowerPC
module RegAlloc.Linear.PPC.FreeRegs
where
module GHC.CmmToAsm.Reg.Linear.PPC where
import GhcPrelude
import PPC.Regs
import RegClass
import Reg
import GHC.CmmToAsm.PPC.Regs
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import Outputable
import GHC.Platform
......
{-# LANGUAGE CPP #-}
-- | Free regs map for SPARC
module RegAlloc.Linear.SPARC.FreeRegs
where
module GHC.CmmToAsm.Reg.Linear.SPARC where
import GhcPrelude
import SPARC.Regs
import RegClass
import Reg
import GHC.CmmToAsm.SPARC.Regs
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GHC.Platform.Regs
import Outputable
......
......@@ -10,7 +10,7 @@
-- associated, a stack slot is never "freed" or removed from the StackMap again,
-- it remains associated until we are done with the current CmmProc.
--
module RegAlloc.Linear.StackMap (
module GHC.CmmToAsm.Reg.Linear.StackMap (
StackSlot,
StackMap(..),
emptyStackMap,
......
......@@ -9,7 +9,7 @@
-- Here we keep all the state that the register allocator keeps track
-- of as it walks the instructions in a basic block.
module RegAlloc.Linear.State (
module GHC.CmmToAsm.Reg.Linear.State (
RA_State(..),
RegM,
runR,
......@@ -38,12 +38,12 @@ where
import GhcPrelude
import RegAlloc.Linear.Stats
import RegAlloc.Linear.StackMap
import RegAlloc.Linear.Base
import RegAlloc.Liveness
import Instruction
import Reg
import GHC.CmmToAsm.Reg.Linear.Stats
import GHC.CmmToAsm.Reg.Linear.StackMap
import GHC.CmmToAsm.Reg.Linear.Base
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.Cmm.BlockId
import GHC.Driver.Session
......
module RegAlloc.Linear.Stats (
module GHC.CmmToAsm.Reg.Linear.Stats (
binSpillReasons,
countRegRegMovesNat,
pprStats
......@@ -8,9 +8,9 @@ where
import GhcPrelude
import RegAlloc.Linear.Base
import RegAlloc.Liveness
import Instruction
import GHC.CmmToAsm.Reg.Linear.Base
import GHC.CmmToAsm.Reg.Liveness
import GHC.CmmToAsm.Instr
import UniqFM
import Outputable
......
-- | Free regs map for i386
module RegAlloc.Linear.X86.FreeRegs
where
module GHC.CmmToAsm.Reg.Linear.X86 where
import GhcPrelude
import X86.Regs
import RegClass
import Reg
import GHC.CmmToAsm.X86.Regs
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import Panic
import GHC.Platform
......
-- | Free regs map for x86_64
module RegAlloc.Linear.X86_64.FreeRegs
where
module GHC.CmmToAsm.Reg.Linear.X86_64 where
import GhcPrelude
import X86.Regs
import RegClass
import Reg
import GHC.CmmToAsm.X86.Regs
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import Panic
import GHC.Platform
......
......@@ -13,7 +13,7 @@
--
-----------------------------------------------------------------------------
module RegAlloc.Liveness (
module GHC.CmmToAsm.Reg.Liveness (
RegSet,
RegMap, emptyRegMap,
BlockMap, mapEmpty,
......@@ -39,11 +39,11 @@ module RegAlloc.Liveness (
) where
import GhcPrelude
import Reg
import Instruction
import GHC.Platform.Reg
import GHC.CmmToAsm.Instr
import GHC.Cmm.BlockId
import CFG
import GHC.CmmToAsm.CFG
import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow.Label
import GHC.Cmm hiding (RegSet, emptyRegSet)
......
......@@ -8,7 +8,7 @@
-- Instruction somehow.
--
-- TODO: We should also make arch specific versions of RegAlloc.Graph.TrivColorable
module TargetReg (
module GHC.CmmToAsm.Reg.Target (
targetVirtualRegSqueeze,
targetRealRegSqueeze,
targetClassOfRealReg,
......@@ -23,20 +23,18 @@ where
import GhcPrelude
import Reg
import RegClass
import Format
import GHC.Platform.Reg
import GHC.Platform.Reg.Class
import GHC.CmmToAsm.Format
import Outputable
import Unique
import GHC.Platform
import qualified X86.Regs as X86
import qualified X86.RegInfo as X86
import qualified PPC.Regs as PPC
import qualified SPARC.Regs as SPARC
import qualified GHC.CmmToAsm.X86.Regs as X86
import qualified GHC.CmmToAsm.X86.RegInfo as X86
import qualified GHC.CmmToAsm.PPC.Regs as PPC
import qualified GHC.CmmToAsm.SPARC.Regs as SPARC
targetVirtualRegSqueeze :: Platform -> RegClass -> VirtualReg -> Int
targetVirtualRegSqueeze platform
......
module SPARC.AddrMode (
module GHC.CmmToAsm.SPARC.AddrMode (
AddrMode(..),
addrOffset
)
......@@ -8,9 +8,9 @@ where
import GhcPrelude
import SPARC.Imm
import SPARC.Base
import Reg
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.Base
import GHC.Platform.Reg
-- addressing modes ------------------------------------------------------------
......
......@@ -5,7 +5,7 @@
-- In the interests of cross-compilation, we want to free ourselves
-- from the autoconf generated modules like main/Constants
module SPARC.Base (
module GHC.CmmToAsm.SPARC.Base (
wordLength,
wordLengthInBits,
spillAreaLength,
......
......@@ -9,7 +9,7 @@
-----------------------------------------------------------------------------
{-# LANGUAGE GADTs #-}
module SPARC.CodeGen (
module GHC.CmmToAsm.SPARC.CodeGen (
cmmTopCodeGen,
generateJumpTableForInstr,
InstrBlock
......@@ -22,21 +22,21 @@ where
-- NCG stuff:
import GhcPrelude
import SPARC.Base
import SPARC.CodeGen.Sanity
import SPARC.CodeGen.Amode
import SPARC.CodeGen.CondCode
import SPARC.CodeGen.Gen64
import SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base
import SPARC.Instr
import SPARC.Imm
import SPARC.AddrMode
import SPARC.Regs
import SPARC.Stack
import Instruction
import Format
import NCGMonad ( NatM, getNewRegNat, getNewLabelNat )
import GHC.CmmToAsm.SPARC.Base
import GHC.CmmToAsm.SPARC.CodeGen.Sanity
import GHC.CmmToAsm.SPARC.CodeGen.Amode
import GHC.CmmToAsm.SPARC.CodeGen.CondCode
import GHC.CmmToAsm.SPARC.CodeGen.Gen64
import GHC.CmmToAsm.SPARC.CodeGen.Gen32
import GHC.CmmToAsm.SPARC.CodeGen.Base
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.SPARC.Stack
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.Format
import GHC.CmmToAsm.Monad ( NatM, getNewRegNat, getNewLabelNat )
-- Our intermediate code:
import GHC.Cmm.BlockId
......@@ -45,10 +45,10 @@ import GHC.Cmm.Utils
import GHC.Cmm.Switch
import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Graph
import PIC
import Reg
import GHC.CmmToAsm.PIC
import GHC.Platform.Reg
import GHC.Cmm.CLabel
import CPrim
import GHC.CmmToAsm.CPrim
-- The rest:
import BasicTypes
......
module SPARC.CodeGen.Amode (
module GHC.CmmToAsm.SPARC.CodeGen.Amode (
getAmode
)
......@@ -6,15 +6,15 @@ where
import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base
import SPARC.AddrMode
import SPARC.Imm
import SPARC.Instr
import SPARC.Regs
import SPARC.Base
import NCGMonad
import Format
import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32
import GHC.CmmToAsm.SPARC.CodeGen.Base
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.SPARC.Base
import GHC.CmmToAsm.Monad
import GHC.CmmToAsm.Format
import GHC.Cmm
......
module SPARC.CodeGen.Base (
module GHC.CmmToAsm.SPARC.CodeGen.Base (
InstrBlock,
CondCode(..),
ChildCode64(..),
......@@ -15,12 +15,12 @@ where
import GhcPrelude
import SPARC.Instr
import SPARC.Cond
import SPARC.AddrMode
import SPARC.Regs
import Format
import Reg
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Cond
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.Format
import GHC.Platform.Reg
import GHC.Platform.Regs
import GHC.Driver.Session
......
module SPARC.CodeGen.CondCode (
module GHC.CmmToAsm.SPARC.CodeGen.CondCode (
getCondCode,
condIntCode,
condFltCode
......@@ -8,15 +8,15 @@ where
import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base
import SPARC.Instr
import SPARC.Regs
import SPARC.Cond
import SPARC.Imm
import SPARC.Base
import NCGMonad
import Format
import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32
import GHC.CmmToAsm.SPARC.CodeGen.Base
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.SPARC.Cond
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.Base
import GHC.CmmToAsm.Monad
import GHC.CmmToAsm.Format
import GHC.Cmm
......
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-- | Expand out synthetic instructions into single machine instrs.
module SPARC.CodeGen.Expand (
module GHC.CmmToAsm.SPARC.CodeGen.Expand (
expandTop
)
......@@ -9,13 +9,13 @@ where
import GhcPrelude
import SPARC.Instr
import SPARC.Imm
import SPARC.AddrMode
import SPARC.Regs
import Instruction
import Reg
import Format
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg
import GHC.CmmToAsm.Format
import GHC.Cmm
......
-- | Evaluation of 32 bit values.
module SPARC.CodeGen.Gen32 (
module GHC.CmmToAsm.SPARC.CodeGen.Gen32 (
getSomeReg,
getRegister
)
......@@ -8,20 +8,20 @@ where
import GhcPrelude
import SPARC.CodeGen.CondCode
import SPARC.CodeGen.Amode
import SPARC.CodeGen.Gen64
import SPARC.CodeGen.Base
import SPARC.Stack
import SPARC.Instr
import SPARC.Cond
import SPARC.AddrMode
import SPARC.Imm
import SPARC.Regs
import SPARC.Base
import NCGMonad
import Format
import Reg
import GHC.CmmToAsm.SPARC.CodeGen.CondCode
import GHC.CmmToAsm.SPARC.CodeGen.Amode
import GHC.CmmToAsm.SPARC.CodeGen.Gen64
import GHC.CmmToAsm.SPARC.CodeGen.Base
import GHC.CmmToAsm.SPARC.Stack
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Cond
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.SPARC.Base
import GHC.CmmToAsm.Monad
import GHC.CmmToAsm.Format
import GHC.Platform.Reg
import GHC.Cmm
......
module SPARC.CodeGen.Gen32 (
module GHC.CmmToAsm.SPARC.CodeGen.Gen32 (
getSomeReg,
getRegister
)
where
import SPARC.CodeGen.Base
import NCGMonad
import Reg
import GHC.CmmToAsm.SPARC.CodeGen.Base
import GHC.CmmToAsm.Monad
import GHC.Platform.Reg
import GHC.Cmm
......
-- | Evaluation of 64 bit values on 32 bit platforms.
module SPARC.CodeGen.Gen64 (
module GHC.CmmToAsm.SPARC.CodeGen.Gen64 (
assignMem_I64Code,
assignReg_I64Code,
iselExpr64
......@@ -9,18 +9,18 @@ where
import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base
import SPARC.CodeGen.Amode
import SPARC.Regs
import SPARC.AddrMode
import SPARC.Imm
import SPARC.Instr
-- import SPARC.Ppr()
import NCGMonad
import Instruction
import Format
import Reg
import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32
import GHC.CmmToAsm.SPARC.CodeGen.Base
import GHC.CmmToAsm.SPARC.CodeGen.Amode
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.Instr
-- GHC.CmmToAsm.SPARC.Ppr()
import GHC.CmmToAsm.Monad
import GHC.CmmToAsm.Instr
import GHC.CmmToAsm.Format
import GHC.Platform.Reg
import GHC.Cmm
......
-- | One ounce of sanity checking is worth 10000000000000000 ounces
-- of staring blindly at assembly code trying to find the problem..
module SPARC.CodeGen.Sanity (
module GHC.CmmToAsm.SPARC.CodeGen.Sanity (
checkBlock
)
......@@ -8,9 +8,9 @@ where
import GhcPrelude
import SPARC.Instr
import SPARC.Ppr () -- For Outputable instances
import Instruction
import GHC.CmmToAsm.SPARC.Instr
import GHC.CmmToAsm.SPARC.Ppr () -- For Outputable instances
import GHC.CmmToAsm.Instr
import GHC.Cmm
......
module SPARC.Cond (
module GHC.CmmToAsm.SPARC.Cond (
Cond(..),
condUnsigned,
condToSigned,
......
module SPARC.Imm (
module GHC.CmmToAsm.SPARC.Imm (
-- immediate values
Imm(..),
strImmLit,
......
......@@ -9,7 +9,7 @@
-----------------------------------------------------------------------------
#include "HsVersions.h"
module SPARC.Instr (
module GHC.CmmToAsm.SPARC.Instr (
RI(..),
riZero,
......@@ -26,17 +26,17 @@ where
import GhcPrelude
import SPARC.Stack
import SPARC.Imm
import SPARC.AddrMode
import SPARC.Cond
import SPARC.Regs
import SPARC.Base
import TargetReg
import Instruction
import RegClass
import Reg
import Format
import GHC.CmmToAsm.SPARC.Stack
import GHC.CmmToAsm.SPARC.Imm
import GHC.CmmToAsm.SPARC.AddrMode
import GHC.CmmToAsm.SPARC.Cond
import GHC.CmmToAsm.SPARC.Regs
import GHC.CmmToAsm.SPARC.Base
import GHC.CmmToAsm.Reg.Target
import GHC.CmmToAsm.Instr
import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GHC.CmmToAsm.Format
import GHC.Cmm.CLabel
import GHC.Platform.Regs
......
......@@ -10,7 +10,7 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module SPARC.Ppr (
module GHC.CmmToAsm.SPARC.Ppr (
pprNatCmmDecl,
pprBasicBlock,
pprData,
......@@ -26,16 +26,16 @@ where
import GhcPrelude
import SPARC.Regs
import SPARC.Instr
import SPARC.Cond
import SPARC.Imm
import SPARC.AddrMode
import SPARC.Base