[mlir][NFC] Provide accessor for TableGen record

Constraint and Predicate classes did not expose their underlying
tablegen records. This means that for Constraints, it is not possible
to get the underlying base constraint of a variadic constraint.
For Predicate, it is not possible to get the predicates forming an
`Or` predicate for instance.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D133264
This commit is contained in:
Mathieu Fehr 2022-09-08 08:46:59 -07:00 committed by Jeff Niu
parent 444f08c832
commit a8c647dbe6
2 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,9 @@ public:
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;

View File

@ -67,6 +67,9 @@ public:
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};