forked from OSchip/llvm-project
Add a convenient `clone()` method on the `Op` class that forward to the underlying `Operation` (NFC)
PiperOrigin-RevId: 266685852
This commit is contained in:
parent
765d60fd4d
commit
8ce2274d0d
|
@ -906,6 +906,16 @@ public:
|
|||
/// 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(); }
|
||||
|
||||
|
|
|
@ -94,10 +94,16 @@ public:
|
|||
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.
|
||||
|
|
Loading…
Reference in New Issue