Skip to content

Commit

Permalink
Revert "Allow for rewriting of for loops resulting from extension for…
Browse files Browse the repository at this point in the history
…wards"

This reverts commit a8e43c9.
  • Loading branch information
krame505 committed Apr 15, 2020
1 parent 985a9a5 commit e64b57c
Showing 1 changed file with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ top::Stmt ::= s::Stmt t::Transformation
ppConcat([pp"transform ", braces(nestlines(2, s.pp)), pp" by ", braces(nestlines(2, t.pp))]);
top.functionDefs := [];

local normalizedS::Stmt = rewriteWith(normalizeLoops, s.hostStmts).fromJust;
local normalizedS::Stmt = rewriteWith(normalizeLoops, new(s)).fromJust;
normalizedS.env = s.env;
normalizedS.returnType = s.returnType;

Expand All @@ -40,45 +40,6 @@ top::Stmt ::= s::Stmt t::Transformation
else transResult.hostTrans;
}

-- Translate away extensions that forward down to for loops before applying rewrites
synthesized attribute hostStmts::Stmt occurs on Stmt;

aspect default production
top::Stmt ::=
{
top.hostStmts = top;
}

aspect production seqStmt
top::Stmt ::= h::Stmt t::Stmt
{
propagate hostStmts;
}

aspect production compoundStmt
top::Stmt ::= s::Stmt
{
propagate hostStmts;
}

aspect production forDeclStmt
top::Stmt ::= i::Decl c::MaybeExpr s::MaybeExpr b::Stmt
{
propagate hostStmts;
}

aspect production ifStmt
top::Stmt ::= c::Expr t::Stmt e::Stmt
{
propagate hostStmts;
}

aspect production decStmt
top::Stmt ::= s::Decorated Stmt
{
top.hostStmts = s.hostStmts;
}

function rename
s:Strategy ::= n1::String n2::String
{
Expand Down

0 comments on commit e64b57c

Please sign in to comment.