This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Rewrite] Add support for using an operation with no results as location
ClosedPublic

Authored by zero9178 on Feb 3 2022, 3:32 AM.

Details

Summary

Prior to this patch, using an operation without any results as the location would result in the generation of invalid C++ code. It'd try to format using the result values, which would would end up being an empty string for an operation without any.
This patch fixes that issue by instead using getValueAndRangeUse which handles both ranges as well as the case for an op without any results.

Diff Detail

Event Timeline

zero9178 created this revision.Feb 3 2022, 3:32 AM
zero9178 requested review of this revision.Feb 3 2022, 3:32 AM
jpienaar accepted this revision.Feb 3 2022, 5:49 AM

Nice, thanks!

This revision is now accepted and ready to land.Feb 3 2022, 5:49 AM
This revision was landed with ongoing or failed builds.Feb 3 2022, 6:08 AM
This revision was automatically updated to reflect the committed changes.