forked from OSchip/llvm-project
[mlir] Forward listeners when utilizing scf::IfOp::get*BodyBuilder.
Without this PatternRewriting infrastructure does not know of modifications and cannot properly legalize nor rollback changes. Differential Revision: https://reviews.llvm.org/D89129
This commit is contained in:
parent
8a836daaa9
commit
46dd827232
|
@ -251,15 +251,15 @@ def IfOp : SCF_Op<"if",
|
|||
];
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
OpBuilder getThenBodyBuilder() {
|
||||
OpBuilder getThenBodyBuilder(OpBuilder::Listener *listener = nullptr) {
|
||||
Block* body = getBody(0);
|
||||
return results().empty() ? OpBuilder::atBlockTerminator(body)
|
||||
: OpBuilder::atBlockEnd(body);
|
||||
return results().empty() ? OpBuilder::atBlockTerminator(body, listener)
|
||||
: OpBuilder::atBlockEnd(body, listener);
|
||||
}
|
||||
OpBuilder getElseBodyBuilder() {
|
||||
OpBuilder getElseBodyBuilder(OpBuilder::Listener *listener = nullptr) {
|
||||
Block* body = getBody(1);
|
||||
return results().empty() ? OpBuilder::atBlockTerminator(body)
|
||||
: OpBuilder::atBlockEnd(body);
|
||||
return results().empty() ? OpBuilder::atBlockTerminator(body, listener)
|
||||
: OpBuilder::atBlockEnd(body, listener);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue