MLIR
20.0.0git
|
Add support for llvm style casts. More...
#include "mlir/IR/Types.h"
Static Public Member Functions | |
static bool | isPossible (mlir::Type ty) |
Arguments are taken as mlir::Type here and not as From , because when casting from an intermediate type of the hierarchy to one of its children, the val.getTypeID() inside T::classof will use the static getTypeID of the parent instead of the non-static Type::getTypeID that returns the dynamic ID. More... | |
static To | doCast (mlir::Type ty) |
Add support for llvm style casts.
We provide a cast between To and From if From is mlir::Type or derives from it
|
inlinestatic |
Definition at line 426 of file Types.h.
References mlir::Type::getImpl().
|
inlinestatic |
Arguments are taken as mlir::Type here and not as From
, because when casting from an intermediate type of the hierarchy to one of its children, the val.getTypeID() inside T::classof will use the static getTypeID of the parent instead of the non-static Type::getTypeID that returns the dynamic ID.
This means that T::classof would end up comparing the static TypeID of the children to the static TypeID of its parent, making it impossible to downcast from the parent to the child.
Return a constant true instead of a dynamic true when casting to self or up the hierarchy.