diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -21,6 +21,7 @@ #include "mlir/IR/Operation.h" #include +#include "llvm/Support/Debug.h" namespace mlir { class Builder; @@ -979,8 +980,9 @@ /// Return true if this "op class" can match against the specified operation. static bool classof(Operation *op) { - if (auto *abstractOp = op->getAbstractOperation()) - return &classof == abstractOp->classof; + if (auto *abstractOp = op->getAbstractOperation()) { + if(&classof == abstractOp->classof) return true; + } return op->getName().getStringRef() == ConcreteType::getOperationName(); }