Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
qir
Commits
202bc08b
Commit
202bc08b
authored
7 years ago
by
Julien Lopez
Browse files
Options
Downloads
Patches
Plain Diff
Fix in GreedyReduce
parent
4fc63676
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/qir/driver/QIRGreedyReduceVisitor.java
+8
-3
8 additions, 3 deletions
src/qir/driver/QIRGreedyReduceVisitor.java
with
8 additions
and
3 deletions
src/qir/driver/QIRGreedyReduceVisitor.java
+
8
−
3
View file @
202bc08b
...
@@ -74,7 +74,12 @@ final class QIRGreedyReduceVisitor implements IQIRVisitor<QIRNode> {
...
@@ -74,7 +74,12 @@ final class QIRGreedyReduceVisitor implements IQIRVisitor<QIRNode> {
@Override
@Override
public
final
QIRNode
visit
(
final
QIRLambda
qirLambda
)
{
public
final
QIRNode
visit
(
final
QIRLambda
qirLambda
)
{
return
new
QIRLambda
(
qirLambda
.
sourceSection
,
qirLambda
.
funName
,
qirLambda
.
var
,
qirLambda
.
body
.
accept
(
this
),
qirLambda
.
target
.
getRootNode
().
getFrameDescriptor
());
if
(
qirLambda
.
var
==
null
||
!
env
.
containsKey
(
qirLambda
.
var
.
id
))
return
new
QIRLambda
(
qirLambda
.
sourceSection
,
qirLambda
.
funName
,
qirLambda
.
var
,
qirLambda
.
body
.
accept
(
this
),
qirLambda
.
target
.
getRootNode
().
getFrameDescriptor
());
final
QIRNode
value
=
env
.
remove
(
qirLambda
.
var
.
id
);
final
QIRLambda
res
=
new
QIRLambda
(
qirLambda
.
sourceSection
,
qirLambda
.
funName
,
qirLambda
.
var
,
qirLambda
.
body
.
accept
(
this
),
qirLambda
.
target
.
getRootNode
().
getFrameDescriptor
());
env
.
put
(
qirLambda
.
var
.
id
,
value
);
return
res
;
}
}
@Override
@Override
...
@@ -90,9 +95,9 @@ final class QIRGreedyReduceVisitor implements IQIRVisitor<QIRNode> {
...
@@ -90,9 +95,9 @@ final class QIRGreedyReduceVisitor implements IQIRVisitor<QIRNode> {
return
fun
.
body
;
return
fun
.
body
;
final
String
varName
=
var
.
id
;
final
String
varName
=
var
.
id
;
env
.
put
(
varName
,
right
);
env
.
put
(
varName
,
right
);
final
QIR
Lambda
res
=
(
QIRLambda
)
fun
.
accept
(
this
);
final
QIR
Node
res
=
fun
.
body
.
accept
(
this
);
env
.
remove
(
varName
);
env
.
remove
(
varName
);
return
res
.
body
;
return
res
;
}
}
@Override
@Override
...
...
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