File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ enum OperandKind {
6060 Arg,
6161 Global,
6262 Predicate,
63+ OpKindBinOp,
6364 UnimplementedOperand = 255 ,
6465};
6566
@@ -330,7 +331,7 @@ class YkIRWriter {
330331 // left-hand side:
331332 serialiseOperand (I, VLMap, I->getOperand (0 ));
332333 // binary operator:
333- serialiseBinOperator (I->getOpcode ());
334+ serialiseBinOperatorOperand (I->getOpcode ());
334335 // right-hand side:
335336 serialiseOperand (I, VLMap, I->getOperand (1 ));
336337
@@ -339,7 +340,10 @@ class YkIRWriter {
339340 }
340341
341342 // Serialise a binary operator.
342- void serialiseBinOperator (Instruction::BinaryOps BO) {
343+ void serialiseBinOperatorOperand (Instruction::BinaryOps BO) {
344+ // operand kind:
345+ OutStreamer.emitInt8 (OperandKind::OpKindBinOp);
346+ // the operator:
343347 switch (BO) {
344348 case Instruction::BinaryOps::Add:
345349 OutStreamer.emitInt8 (BinOp::BinOpAdd);
@@ -395,8 +399,8 @@ class YkIRWriter {
395399 case Instruction::BinaryOps::URem:
396400 OutStreamer.emitInt8 (BinOp::BinOpURem);
397401 break ;
398- case Instruction::BinaryOps::BinaryOpsEnd :
399- break ;
402+ default :
403+ llvm::report_fatal_error ( " unknown binary operator " ) ;
400404 }
401405 }
402406
You can’t perform that action at this time.
0 commit comments