MCPcopy Create free account
hub / github.com/chigraph/chigraph / CompareNodeType

Method CompareNodeType

libchigraph/src/LangModule.cpp:464–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462
463struct 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,

Callers

nothing calls this directly

Calls 1

typeFromNameMethod · 0.45

Tested by

no test coverage detected