forked from OSchip/llvm-project
[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:
parent
444f08c832
commit
a8c647dbe6
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in New Issue