Skip to content
Commit 287d1110 authored by Alex Zinenko's avatar Alex Zinenko Committed by Mehdi Amini
Browse files

Generalize implicit terminator into an OpTrait

Several groups of operations in different dialects (e.g. AffineForOp,
AffineIfOp; loop::ForOp, loop::IfOp) share the requirement for their regions to
contain 0 or 1 block, and for blocks to always have a specific terminator type.
Furthermore, this terminator may be omitted from the custom syntax.  Generalize
this behavior into OpTrait::SingleBlockImplicitTerminator, parameterized by the
terminator operation type.  This trait provides the verifier that checks the
presence of the terminator, and utility functions adding the terminator in case
of absence.

PiperOrigin-RevId: 258957180
parent 6204acac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment