15#ifndef MLIR_IR_ACTION_H
16#define MLIR_IR_ACTION_H
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/ADT/Sequence.h"
22#include "llvm/ADT/StringMap.h"
23#include "llvm/Support/TypeName.h"
24#include "llvm/Support/raw_ostream.h"
48 virtual StringRef
getTag()
const = 0;
51 os <<
"Action \"" <<
getTag() <<
"\"";
75template <
typename Derived>
87 StringRef
getTag() const final {
return Derived::tag; }
This class provides an efficient unique identifier for a specific C++ type.
static TypeID get()
Construct a type info object for the given type T.
static bool classof(const Action *action)
Provide classof to allow casting between action types.
ActionImpl(ArrayRef< IRUnit > irUnits={})
StringRef getTag() const final
Forward tag access to the derived class.
An action is a specific action that is to be taken by the compiler, that can be toggled and controlle...
virtual ~Action()=default
TypeID getActionID() const
Return the unique action id of this action, use for casting functionality.
Action(TypeID actionID, ArrayRef< IRUnit > irUnits)
virtual void print(raw_ostream &os) const
virtual StringRef getTag() const =0
Return a string "tag" which intends to uniquely identify this type of action.
ArrayRef< IRUnit > irUnits
Set of IR units (operations, regions, blocks, values) that are associated with this action.
virtual ArrayRef< IRUnit > getContextIRUnits() const
Return the set of IR units that are associated with this action.
TypeID actionID
The type of the derived action class, used for isa/dyn_cast.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...