This is an archive of the discontinued LLVM Phabricator instance.

Improve error message when creating an op that isn't registered in the context
ClosedPublic

Authored by mehdi_amini on Sep 7 2021, 10:35 AM.

Details

Summary

This prints a more helpful error for folks who aren't intrinsically
familiar with the system.

Diff Detail

Event Timeline

mehdi_amini created this revision.Sep 7 2021, 10:35 AM
mehdi_amini requested review of this revision.Sep 7 2021, 10:35 AM
ftynse accepted this revision.Sep 7 2021, 11:11 AM
ftynse added inline comments.
mlir/include/mlir/IR/Builders.h
425–426

Nit: can we factor this out into a checkHasAbstractOperation() function to avoid duplicating the long message? Also, this copy doesn't have LLVM_UNLIKELY.

This revision is now accepted and ready to land.Sep 7 2021, 11:11 AM
jpienaar accepted this revision.Sep 7 2021, 11:18 AM
GMNGeoffrey accepted this revision.Sep 7 2021, 11:19 AM

Thanks! I second Alex's suggestion :-)

Refactor in a helper function

This revision was landed with ongoing or failed builds.Sep 7 2021, 1:42 PM
This revision was automatically updated to reflect the committed changes.