| 462 | |
| 463 | struct CompareNodeType : NodeType { |
| 464 | CompareNodeType(LangModule& mod, DataType ty, CmpOp op) |
| 465 | : NodeType(mod), mCompOp(op), mType{ty} { |
| 466 | makePure(); |
| 467 | |
| 468 | std::string opStr = [](CmpOp b) { |
| 469 | switch (b) { |
| 470 | case CmpOp::Lt: return "<"; |
| 471 | case CmpOp::Gt: return ">"; |
| 472 | case CmpOp::Let: return "<="; |
| 473 | case CmpOp::Get: return ">="; |
| 474 | case CmpOp::Eq: return "=="; |
| 475 | case CmpOp::Neq: return "!="; |
| 476 | default: return ""; |
| 477 | } |
| 478 | return ""; |
| 479 | }(mCompOp); |
| 480 | |
| 481 | setName(ty.unqualifiedName() + opStr + ty.unqualifiedName()); |
| 482 | setDescription(ty.unqualifiedName() + opStr + ty.unqualifiedName()); |
| 483 | |
| 484 | setDataInputs({{"a", ty}, {"b", ty}}); |
| 485 | setDataOutputs({{"", mod.typeFromName("i1")}}); |
| 486 | } |
| 487 | |
| 488 | Result codegen( |
| 489 | size_t /*execInputID*/, const llvm::DebugLoc& nodeLocation, |
nothing calls this directly
no test coverage detected