MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::Operation::CloneOptions Class Reference

Class encompassing various options related to cloning an operation. More...

#include "mlir/IR/Operation.h"

Public Member Functions

 CloneOptions ()
 Default constructs an option with all flags set to false. More...
 
 CloneOptions (bool cloneRegions, bool cloneOperands)
 Constructs an instance with the clone regions and clone operands flags set accordingly. More...
 
CloneOptionscloneRegions (bool enable=true)
 Configures whether cloning should traverse into any of the regions of the operation. More...
 
bool shouldCloneRegions () const
 Returns whether regions of the operation should be cloned as well. More...
 
CloneOptionscloneOperands (bool enable=true)
 Configures whether operation' operands should be cloned. More...
 
bool shouldCloneOperands () const
 Returns whether operands should be cloned as well. More...
 

Static Public Member Functions

static CloneOptions all ()
 Returns an instance with all flags set to true. More...
 

Detailed Description

Class encompassing various options related to cloning an operation.

Users of this class should pass it to Operation's 'clone' methods. Current options include:

Definition at line 143 of file Operation.h.

Constructor & Destructor Documentation

◆ CloneOptions() [1/2]

Operation::CloneOptions::CloneOptions ( )

Default constructs an option with all flags set to false.

That means all parts of an operation that may optionally not be cloned, are not cloned.

Definition at line 679 of file Operation.cpp.

◆ CloneOptions() [2/2]

Operation::CloneOptions::CloneOptions ( bool  cloneRegions,
bool  cloneOperands 
)

Constructs an instance with the clone regions and clone operands flags set accordingly.

Definition at line 682 of file Operation.cpp.

Member Function Documentation

◆ all()

Operation::CloneOptions Operation::CloneOptions::all ( )
static

Returns an instance with all flags set to true.

This is the default when using the clone method and clones all parts of the operation.

Definition at line 685 of file Operation.cpp.

References cloneOperands(), and cloneRegions().

Referenced by mlir::Region::cloneInto(), and mlir::Operation::cloneWithoutRegions().

◆ cloneOperands()

Operation::CloneOptions & Operation::CloneOptions::cloneOperands ( bool  enable = true)

Configures whether operation' operands should be cloned.

Otherwise the resulting clones will simply have zero operands.

Definition at line 694 of file Operation.cpp.

Referenced by all(), and mlir::Region::cloneInto().

◆ cloneRegions()

Operation::CloneOptions & Operation::CloneOptions::cloneRegions ( bool  enable = true)

Configures whether cloning should traverse into any of the regions of the operation.

If set to true, the operation's regions are recursively cloned. If set to false, cloned operations will have the same number of regions, but they will be empty. Cloning of nested operations in the operation's regions are currently unaffected by other flags.

Definition at line 689 of file Operation.cpp.

Referenced by all(), and mlir::Region::cloneInto().

◆ shouldCloneOperands()

bool mlir::Operation::CloneOptions::shouldCloneOperands ( ) const
inline

Returns whether operands should be cloned as well.

Definition at line 173 of file Operation.h.

◆ shouldCloneRegions()

bool mlir::Operation::CloneOptions::shouldCloneRegions ( ) const
inline

Returns whether regions of the operation should be cloned as well.

Definition at line 166 of file Operation.h.


The documentation for this class was generated from the following files: