MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / parseComparisonPredicate

Function parseComparisonPredicate

lib/Dialect/CudaTile/IR/CudaTile.cpp:666–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664//===----------------------------------------------------------------------===//
665
666static ParseResult parseComparisonPredicate(OpAsmParser &parser,
667 ComparisonPredicateAttr &attr) {
668 StringRef enumKeyword;
669 SMLoc loc = parser.getCurrentLocation();
670 if (failed(parser.parseKeyword(&enumKeyword)))
671 return parser.emitError(loc)
672 << "expected 'comparison_predicate' to be one "
673 "of: {'equal', 'not_equal', 'less_than', 'less_than_or_equal', "
674 "'greater_than', 'greater_than_or_equal'}";
675 auto maybeEnum = symbolizeComparisonPredicate(enumKeyword);
676 if (!maybeEnum)
677 return parser.emitError(loc)
678 << "expected 'comparison_predicate' to be one "
679 "of: {'equal', 'not_equal', 'less_than', 'less_than_or_equal', "
680 "'greater_than', 'greater_than_or_equal'}";
681 attr = ComparisonPredicateAttr::get(parser.getContext(), *maybeEnum);
682 return success();
683}
684
685static void printComparisonPredicate(OpAsmPrinter &p, Operation *op,
686 ComparisonPredicateAttr attr) {

Callers

nothing calls this directly

Calls 1

emitErrorMethod · 0.80

Tested by

no test coverage detected