/// Return the operation that this refers to.
Operation *getOperation() { return OpState::getOperation(); }
+ /// Create a deep copy of this operation.
+ ConcreteType clone() { return cast<ConcreteType>(getOperation()->clone()); }
+
+ /// Create a partial copy of this operation without traversing into attached
+ /// regions. The new operation will have the same number of regions as the
+ /// original one, but they will be left empty.
+ ConcreteType cloneWithoutRegions() {
+ return cast<ConcreteType>(getOperation()->cloneWithoutRegions());
+ }
+
/// Return the dialect that this refers to.
Dialect *getDialect() { return getOperation()->getDialect(); }
Operation *clone(BlockAndValueMapping &mapper);
Operation *clone();
- /// Create a deep copy of this operation but keep the operation regions empty.
+ /// Create a partial copy of this operation without traversing into attached
+ /// regions. The new operation will have the same number of regions as the
+ /// original one, but they will be left empty.
/// Operands are remapped using `mapper` (if present), and `mapper` is updated
/// to contain the results.
Operation *cloneWithoutRegions(BlockAndValueMapping &mapper);
+
+ /// Create a partial copy of this operation without traversing into attached
+ /// regions. The new operation will have the same number of regions as the
+ /// original one, but they will be left empty.
Operation *cloneWithoutRegions();
/// Returns the operation block that contains this operation.