summaryrefslogtreecommitdiff
path: root/compiler/ndpFlatten/FlattenInfo.hs
blob: f759242455f00026b9c72246ac7e3653817a184e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--  $Id$
--
--  Copyright (c) 2002 Manuel M T Chakravarty & Gabriele Keller
--
--  Information for modules outside of the flattening module collection.
--
--- DESCRIPTION ---------------------------------------------------------------
--
--  This module contains information that is needed, and thus imported, by
--  modules that are otherwise independent of flattening and may in fact be
--  directly or indirectly imported by some of the flattening-related
--  modules.  This is to avoid cyclic module dependencies.
-- 
--- DOCU ----------------------------------------------------------------------
--
--  Language: Haskell 98
--
--- TODO ----------------------------------------------------------------------
--

module FlattenInfo (
  namesNeededForFlattening
) where

import StaticFlags (opt_Flatten)
import NameSet     (FreeVars, emptyFVs, mkFVs)
import PrelNames   (fstName, andName, orName, lengthPName, replicatePName,
		    mapPName, bpermutePName, bpermuteDftPName, indexOfPName)


-- this is a list of names that need to be available if flattening is
-- performed (EXPORTED)
--
--  * needs to be kept in sync with the names used in Core generation in
--   `FlattenMonad' and `NDPCoreUtils'
--
namesNeededForFlattening :: FreeVars
namesNeededForFlattening
  | not opt_Flatten = emptyFVs		-- none without -fflatten
  | otherwise
  = mkFVs [fstName, andName, orName, lengthPName, replicatePName, mapPName,
	   bpermutePName, bpermuteDftPName, indexOfPName]
    -- stuff from PrelGHC doesn't have to go here