Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
H
hoopl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
Packages
hoopl
Commits
a833a369
Commit
a833a369
authored
Dec 25, 2016
by
Ben Karel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dominator join function.
parent
d2f11755
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
src/Compiler/Hoopl/Passes/Dominator.hs
src/Compiler/Hoopl/Passes/Dominator.hs
+3
-9
No files found.
src/Compiler/Hoopl/Passes/Dominator.hs
View file @
a833a369
...
...
@@ -13,6 +13,7 @@ module Compiler.Hoopl.Passes.Dominator
where
import
Data.Maybe
import
qualified
Data.Set
as
Set
import
Compiler.Hoopl
...
...
@@ -47,15 +48,8 @@ domLattice = addPoints "dominators" extend
extend
::
JoinFun
DPath
extend
_
(
OldFact
(
DPath
l
))
(
NewFact
(
DPath
l'
))
=
(
changeIf
(
l
`
lengthDiffers
`
j
),
DPath
j
)
where
j
=
lcs
l
l'
lcs
::
[
Label
]
->
[
Label
]
->
[
Label
]
-- longest common suffix
lcs
l
l'
|
length
l
>
length
l'
=
lcs
(
drop
(
length
l
-
length
l'
)
l
)
l'
|
length
l
<
length
l'
=
lcs
l'
l
|
otherwise
=
dropUnlike
l
l'
l
dropUnlike
[]
[]
maybe_like
=
maybe_like
dropUnlike
(
x
:
xs
)
(
y
:
ys
)
maybe_like
=
dropUnlike
xs
ys
(
if
x
==
y
then
maybe_like
else
xs
)
dropUnlike
_
_
_
=
error
"this can't happen"
where
j
=
filter
(
\
elem
->
Set
.
member
elem
common
)
l
common
=
Set
.
intersection
(
Set
.
fromList
l
)
(
Set
.
fromList
l'
)
lengthDiffers
[]
[]
=
False
lengthDiffers
(
_
:
xs
)
(
_
:
ys
)
=
lengthDiffers
xs
ys
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment