///
/// Constraints that do not meet the restriction that they can only reference
/// `$_self`, `$_op`, and `$_builder` are not uniqued.
- void emitPatternConstraints(const DenseSet<DagLeaf> &constraints);
+ void emitPatternConstraints(const ArrayRef<DagLeaf> constraints);
/// Get the name of the static function used for the given type constraint.
/// These functions are used for operand and result constraints and have the
/// Collect and unique all the constraints used by operations.
void collectOpConstraints(ArrayRef<llvm::Record *> opDefs);
/// Collect and unique all pattern constraints.
- void collectPatternConstraints(const DenseSet<DagLeaf> &constraints);
+ void collectPatternConstraints(ArrayRef<DagLeaf> constraints);
/// The output stream.
raw_ostream &os;
}
void StaticVerifierFunctionEmitter::emitPatternConstraints(
- const llvm::DenseSet<DagLeaf> &constraints) {
+ const llvm::ArrayRef<DagLeaf> constraints) {
collectPatternConstraints(constraints);
emitPatternConstraints();
}
}
void StaticVerifierFunctionEmitter::collectPatternConstraints(
- const llvm::DenseSet<DagLeaf> &constraints) {
+ const llvm::ArrayRef<DagLeaf> constraints) {
for (auto &leaf : constraints) {
assert(leaf.isOperandMatcher() || leaf.isAttrMatcher());
collectConstraint(
int staticMatcherCounter = 0;
// The DagLeaf which contains type or attr constraint.
- DenseSet<DagLeaf> constraints;
+ SetVector<DagLeaf> constraints;
// Static type/attribute verification function emitter.
StaticVerifierFunctionEmitter staticVerifierEmitter;
}
void StaticMatcherHelper::populateStaticConstraintFunctions(raw_ostream &os) {
- staticVerifierEmitter.emitPatternConstraints(constraints);
+ staticVerifierEmitter.emitPatternConstraints(constraints.getArrayRef());
}
void StaticMatcherHelper::addPattern(Record *record) {