ghc-7.0.3: The GHC API

Vectorise.Env

Contents

- Local Environments
- Global Environments

Synopsis

- data Scope a b
  - = Global a
  - | Local b
- data LocalEnv = LocalEnv {
  - local_vars :: VarEnv (Var, Var)
  - local_tyvars :: [TyVar]
  - local_tyvar_pa :: VarEnv CoreExpr
  - local_bind_name :: FastString
  }
- emptyLocalEnv :: LocalEnv
- data GlobalEnv = GlobalEnv {
  - global_vars :: VarEnv Var
  - global_scalars :: VarSet
  - global_exported_vars :: VarEnv (Var, Var)
  - global_tycons :: NameEnv TyCon
  - global_datacons :: NameEnv DataCon
  - global_pa_funs :: NameEnv Var
  - global_pr_funs :: NameEnv Var
  - global_boxed_tycons :: NameEnv TyCon
  - global_inst_env :: (InstEnv, InstEnv)
  - global_fam_inst_env :: FamInstEnvs
  - global_bindings :: [(Var, CoreExpr)]
  }
- initGlobalEnv :: VectInfo -> (InstEnv, InstEnv) -> FamInstEnvs -> GlobalEnv
- extendImportedVarsEnv :: [(Var, Var)] -> GlobalEnv -> GlobalEnv
- extendScalars :: [Var] -> GlobalEnv -> GlobalEnv
- setFamInstEnv :: FamInstEnv -> GlobalEnv -> GlobalEnv
- extendTyConsEnv :: [(Name, TyCon)] -> GlobalEnv -> GlobalEnv
- extendDataConsEnv :: [(Name, DataCon)] -> GlobalEnv -> GlobalEnv
- extendPAFunsEnv :: [(Name, Var)] -> GlobalEnv -> GlobalEnv
- setPRFunsEnv :: [(Name, Var)] -> GlobalEnv -> GlobalEnv
- setBoxedTyConsEnv :: [(Name, TyCon)] -> GlobalEnv -> GlobalEnv
- updVectInfo :: GlobalEnv -> TypeEnv -> VectInfo -> VectInfo

# Documentation

data Scope a b

Indicates what scope something (a variable) is in.

Constructors

Global a |
Local b |

# Local Environments

data LocalEnv

The local environment.

Constructors

LocalEnv |

Fields

local_vars :: VarEnv (Var, Var)
local_tyvars :: [TyVar]
local_tyvar_pa :: VarEnv CoreExpr
local_bind_name :: FastString

emptyLocalEnv :: LocalEnv

Create an empty local environment.

# Global Environments

data GlobalEnv

The global environment. These are things the exist at top-level.

Constructors

GlobalEnv |

Fields

global_vars :: VarEnv Var

  Mapping from global variables to their vectorised versions.

global_scalars :: VarSet

  Purely scalar variables. Code which mentions only these variables doesn't have to be lifted.

global_exported_vars :: VarEnv (Var, Var)

  Exported variables which have a vectorised version.

global_tycons :: NameEnv TyCon

  Mapping from TyCons to their vectorised versions. TyCons which do not have to be vectorised are mapped to themselves.

global_datacons :: NameEnv DataCon

  Mapping from DataCons to their vectorised versions.

global_pa_funs :: NameEnv Var

  Mapping from TyCons to their PA dfuns.

global_pr_funs :: NameEnv Var

  Mapping from TyCons to their PR dfuns.

global_boxed_tycons :: NameEnv TyCon

  Mapping from unboxed TyCons to their boxed versions.

global_inst_env :: (InstEnv, InstEnv)

  External package inst-env & home-package inst-env for class instances.

global_fam_inst_env :: FamInstEnvs

  External package inst-env & home-package inst-env for family instances.

global_bindings :: [(Var, CoreExpr)]

  Hoisted bindings.

initGlobalEnv :: VectInfo -> (InstEnv, InstEnv) -> FamInstEnvs -> GlobalEnv

Create an initial global environment

extendImportedVarsEnv :: [(Var, Var)] -> GlobalEnv -> GlobalEnv

Extend the list of global variables in an environment.

extendScalars :: [Var] -> GlobalEnv -> GlobalEnv

Extend the set of scalar variables in an environment.

setFamInstEnv :: FamInstEnv -> GlobalEnv -> GlobalEnv

Set the list of type family instances in an environment.

extendTyConsEnv :: [(Name, TyCon)] -> GlobalEnv -> GlobalEnv

Extend the list of type constructors in an environment.

extendDataConsEnv :: [(Name, DataCon)] -> GlobalEnv -> GlobalEnv

Extend the list of data constructors in an environment.

extendPAFunsEnv :: [(Name, Var)] -> GlobalEnv -> GlobalEnv

Extend the list of PA functions in an environment.

setPRFunsEnv :: [(Name, Var)] -> GlobalEnv -> GlobalEnv

Set the list of PR functions in an environment.

setBoxedTyConsEnv :: [(Name, TyCon)] -> GlobalEnv -> GlobalEnv

Set the list of boxed type constructor in an environment.

updVectInfo :: GlobalEnv -> TypeEnv -> VectInfo -> VectInfo

TODO: What is this for?