"vscode:/vscode.git/clone" did not exist on "ba878d29b38ad846299b5344a0363868c2737c4b"
Commit 4c42a46d authored by Paul's avatar Paul
Browse files

Add the program to the matcher callback

parent b8a7d3bb
......@@ -217,7 +217,7 @@ void find_matches(program& p, Ms&&... ms)
auto r = match_instruction(p, ins, m.matcher());
if(r.result == p.end())
return;
m.apply(r);
m.apply(p, r);
match = true;
},
ms...);
......
......@@ -355,7 +355,7 @@ struct match_find_sum
migraph::instruction_ref ins;
auto matcher() const { return matchers::name("sum"); }
void apply(matchers::matcher_result r) const { EXPECT(bool{r.result == ins}); }
void apply(migraph::program&, matchers::matcher_result r) const { EXPECT(bool{r.result == ins}); }
};
struct match_find_literal
......@@ -363,7 +363,7 @@ struct match_find_literal
migraph::instruction_ref ins;
auto matcher() const { return matchers::name("@literal"); }
void apply(matchers::matcher_result r) const
void apply(migraph::program&, matchers::matcher_result r) const
{
EXPECT(bool{r.result != ins});
EXPECT(r.result->name() == "@literal");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment