More grooming of custom op parser APIs to allow many of them to use a single
parsing chain and resolve TODOs. NFC.
PiperOrigin-RevId: 207913754
diff --git a/lib/Parser/Parser.cpp b/lib/Parser/Parser.cpp
index 5ca4e56..5c34bff 100644
--- a/lib/Parser/Parser.cpp
+++ b/lib/Parser/Parser.cpp
@@ -1798,11 +1798,14 @@
llvm::SMLoc getNameLoc() const override { return nameLoc; }
bool resolveOperand(OperandType operand, Type *type,
- SSAValue *&result) override {
+ SmallVectorImpl<SSAValue *> &result) override {
FunctionParser::SSAUseInfo operandInfo = {operand.name, operand.number,
operand.location};
- result = parser.resolveSSAUse(operandInfo, type);
- return result == nullptr;
+ if (auto *value = parser.resolveSSAUse(operandInfo, type)) {
+ result.push_back(value);
+ return false;
+ }
+ return true;
}
/// Emit a diagnostic at the specified location and return true.