[spirv] Properly return when finding error in serialization

PiperOrigin-RevId: 280001339
This commit is contained in:
Lei Zhang 2019-11-12 10:33:36 -08:00 committed by A. Unique TensorFlower
parent c4a0883a92
commit f4aca03232
1 changed files with 3 additions and 4 deletions

View File

@ -127,9 +127,8 @@ static void emitOperandSerialization(const Operator &op, ArrayRef<SMLoc> loc,
os << tabs << " auto argID = getValueID(arg);\n";
os << tabs << " if (!argID) {\n";
os << tabs
<< formatv(
" emitError({0}.getLoc(), \"operand {1} has a use before "
"def\");\n",
<< formatv(" return emitError({0}.getLoc(), "
"\"operand #{1} has a use before def\");\n",
opVar, operandNum);
os << tabs << " }\n";
os << tabs << formatv(" {0}.push_back(argID);\n", operands);