summaryrefslogtreecommitdiffstats
path: root/mlir
diff options
context:
space:
mode:
Diffstat (limited to 'mlir')
-rw-r--r--mlir/include/mlir/IR/OpDefinition.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index 6fefeaa5159..199adb85b58 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -606,7 +606,10 @@ public:
/// This is the hook used by the AsmPrinter to emit this to the .mlir file.
/// Op implementations should provide a print method.
static void printAssembly(const Operation *op, OpAsmPrinter *p) {
- op->getAs<ConcreteType>()->print(p);
+ auto opPointer = op->getAs<ConcreteType>();
+ assert(opPointer &&
+ "op's name does not match name of concrete type instantiated with");
+ opPointer->print(p);
}
/// This is the hook that checks whether or not this instruction is well
OpenPOWER on IntegriCloud