diff --git a/mlir/include/mlir/TableGen/Constraint.h b/mlir/include/mlir/TableGen/Constraint.h --- a/mlir/include/mlir/TableGen/Constraint.h +++ b/mlir/include/mlir/TableGen/Constraint.h @@ -71,6 +71,9 @@ Kind getKind() const { return kind; } + /// Return the underlying def. + const llvm::Record &getDef() const { return *def; } + protected: // The TableGen definition of this constraint. const llvm::Record *def; diff --git a/mlir/include/mlir/TableGen/Predicate.h b/mlir/include/mlir/TableGen/Predicate.h --- a/mlir/include/mlir/TableGen/Predicate.h +++ b/mlir/include/mlir/TableGen/Predicate.h @@ -67,6 +67,9 @@ return llvm::hash_value(pred.def); } + /// Return the underlying def. + const llvm::Record &getDef() const { return *def; } + protected: // The TableGen definition of this predicate. const llvm::Record *def{nullptr};