projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add rebindable syntax for if-then-else
[ghc-hetmet.git]
/
compiler
/
cmm
/
CmmParse.y
diff --git
a/compiler/cmm/CmmParse.y
b/compiler/cmm/CmmParse.y
index
33a4b80
..
aaa7c42
100644
(file)
--- a/
compiler/cmm/CmmParse.y
+++ b/
compiler/cmm/CmmParse.y
@@
-411,7
+411,7
@@
stmt :: { ExtCode }
| 'return' maybe_actuals ';'
{ do e <- sequence $2; stmtEC (CmmReturn e) }
| 'if' bool_expr '{' body '}' else
| 'return' maybe_actuals ';'
{ do e <- sequence $2; stmtEC (CmmReturn e) }
| 'if' bool_expr '{' body '}' else
- { ifThenElse $2 $4 $6 }
+ { cmmIfThenElse $2 $4 $6 }
opt_never_returns :: { CmmReturnInfo }
: { CmmMayReturn }
opt_never_returns :: { CmmReturnInfo }
: { CmmMayReturn }
@@
-947,7
+947,7
@@
data BoolExpr
-- ToDo: smart constructors which simplify the boolean expression.
-- ToDo: smart constructors which simplify the boolean expression.
-ifThenElse cond then_part else_part = do
+cmmIfThenElse cond then_part else_part = do
then_id <- code newLabelC
join_id <- code newLabelC
c <- cond
then_id <- code newLabelC
join_id <- code newLabelC
c <- cond