// Returns this op's C++ class name prefixed with namespaces.
std::string getQualCppClassName() const;
+ using value_iterator = NamedTypeConstraint *;
+
+ // Op result iterators.
+ value_iterator result_begin();
+ value_iterator result_end();
+ llvm::iterator_range<value_iterator> getResults();
+
// Returns the number of results this op produces.
int getNumResults() const;
const NamedAttribute &getAttribute(int index) const;
// Op operand iterators.
- using operand_iterator = NamedTypeConstraint *;
- operand_iterator operand_begin();
- operand_iterator operand_end();
- llvm::iterator_range<operand_iterator> getOperands();
+ value_iterator operand_begin();
+ value_iterator operand_end();
+ llvm::iterator_range<value_iterator> getOperands();
int getNumOperands() const { return operands.size(); }
NamedTypeConstraint &getOperand(int index) { return operands[index]; }
const llvm::Record &tblgen::Operator::getDef() const { return def; }
+auto tblgen::Operator::result_begin() -> value_iterator {
+ return results.begin();
+}
+
+auto tblgen::Operator::result_end() -> value_iterator { return results.end(); }
+
+auto tblgen::Operator::getResults() -> llvm::iterator_range<value_iterator> {
+ return {result_begin(), result_end()};
+}
+
tblgen::TypeConstraint
tblgen::Operator::getResultTypeConstraint(int index) const {
DagInit *results = def.getValueAsDag("results");
return {attribute_begin(), attribute_end()};
}
-auto tblgen::Operator::operand_begin() -> operand_iterator {
+auto tblgen::Operator::operand_begin() -> value_iterator {
return operands.begin();
}
-auto tblgen::Operator::operand_end() -> operand_iterator {
+auto tblgen::Operator::operand_end() -> value_iterator {
return operands.end();
}
-auto tblgen::Operator::getOperands() -> llvm::iterator_range<operand_iterator> {
+auto tblgen::Operator::getOperands() -> llvm::iterator_range<value_iterator> {
return {operand_begin(), operand_end()};
}