Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Kaznacheev
GHC
Commits
c0835f89
Commit
c0835f89
authored
13 years ago
by
chak@cse.unsw.edu.au.
Committed by
Ian Lynagh
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix -ddump-tc-trace for recursively defined type constructors
parent
946c947c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compiler/vectorise/Vectorise/Monad/Global.hs
+13
-4
13 additions, 4 deletions
compiler/vectorise/Vectorise/Monad/Global.hs
compiler/vectorise/Vectorise/Type/TyConDecl.hs
+5
-10
5 additions, 10 deletions
compiler/vectorise/Vectorise/Type/TyConDecl.hs
with
18 additions
and
14 deletions
compiler/vectorise/Vectorise/Monad/Global.hs
+
13
−
4
View file @
c0835f89
...
...
@@ -16,7 +16,7 @@ module Vectorise.Monad.Global (
-- * TyCons
lookupTyCon
,
defTyCon
,
globalVectTyCons
,
defTyConName
,
defTyCon
,
globalVectTyCons
,
-- * Datacons
lookupDataCon
,
...
...
@@ -136,9 +136,13 @@ lookupTyCon tc
-- |Add a mapping between plain and vectorised `TyCon`s to the global environment.
--
defTyCon
::
TyCon
->
TyCon
->
VM
()
defTyCon
tc
tc'
=
do
{
traceVt
"add global tycon mapping:"
(
ppr
tc
<+>
text
"-->"
<+>
ppr
tc'
)
-- The second argument is only to enable tracing for (mutually) recursively defined type
-- constructors, where we /must not/ pull at the vectorised type constructors (because that would
-- pull too early at the recursive knot).
--
defTyConName
::
TyCon
->
Name
->
TyCon
->
VM
()
defTyConName
tc
nameOfTc'
tc'
=
do
{
traceVt
"add global tycon mapping:"
(
ppr
tc
<+>
text
"-->"
<+>
ppr
nameOfTc'
)
-- check for duplicate vectorisation
;
currentDef
<-
readGEnv
$
\
env
->
lookupNameEnv
(
global_tycons
env
)
(
tyConName
tc
)
...
...
@@ -158,6 +162,11 @@ defTyCon tc tc'
|
otherwise
=
ptext
(
sLit
"in the current module"
)
-- |Add a mapping between plain and vectorised `TyCon`s to the global environment.
--
defTyCon
::
TyCon
->
TyCon
->
VM
()
defTyCon
tc
tc'
=
defTyConName
tc
(
tyConName
tc'
)
tc'
-- |Get the set of all vectorised type constructors.
--
globalVectTyCons
::
VM
(
NameEnv
TyCon
)
...
...
This diff is collapsed.
Click to expand it.
compiler/vectorise/Vectorise/Type/TyConDecl.hs
+
5
−
10
View file @
c0835f89
...
...
@@ -22,23 +22,21 @@ import Control.Monad
--
vectTyConDecls
::
[
TyCon
]
->
VM
[
TyCon
]
vectTyConDecls
tcs
=
fixV
$
\
tcs'
->
do
{
mapM_
(
uncurry
defTyCon
)
(
zipLazy
tcs
tcs'
)
;
mapM
vectTyConDecl
tcs
do
{
names'
<-
mapM
(
mkLocalisedName
mkVectTyConOcc
.
tyConName
)
tcs
;
mapM_
(
uncurry
(
uncurry
defTyConName
))
(
tcs
`
zip
`
names'
`
zipLazy
`
tcs'
)
;
zipWithM
vectTyConDecl
tcs
names'
}
-- |Vectorise a single type constructor.
--
vectTyConDecl
::
TyCon
->
VM
TyCon
vectTyConDecl
tycon
vectTyConDecl
::
TyCon
->
Name
->
VM
TyCon
vectTyConDecl
tycon
name'
-- Type constructor representing a type class
|
Just
cls
<-
tyConClass_maybe
tycon
=
do
{
unless
(
null
$
classATs
cls
)
$
cantVectorise
"Associated types are not yet supported"
(
ppr
cls
)
-- make the name of the vectorised class tycon: "Class" --> "V:Class"
;
name'
<-
mkLocalisedName
mkVectTyConOcc
(
tyConName
tycon
)
-- vectorise superclass constraint (types)
;
theta'
<-
mapM
vectType
(
classSCTheta
cls
)
...
...
@@ -87,9 +85,6 @@ vectTyConDecl tycon
=
do
{
unless
(
all
isVanillaDataCon
(
tyConDataCons
tycon
))
$
cantVectorise
"Currently only Haskell 2011 datatypes are supported"
(
ppr
tycon
)
-- make the name of the vectorised class tycon
;
name'
<-
mkLocalisedName
mkVectTyConOcc
(
tyConName
tycon
)
-- vectorise the data constructor of the class tycon
;
rhs'
<-
vectAlgTyConRhs
tycon
(
algTyConRhs
tycon
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment