This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Allow to use vformat utility with MLIR classes
ClosedPublic

Authored by vinograd47 on Oct 11 2021, 7:10 AM.

Details

Summary

Make raw_ostream operator<< follow const correctness semantic,
since it is a requirement of FormatVariadic implementation.

Diff Detail

Event Timeline

vinograd47 created this revision.Oct 11 2021, 7:10 AM
vinograd47 requested review of this revision.Oct 11 2021, 7:10 AM
rriddle accepted this revision.Oct 11 2021, 10:43 AM
rriddle added inline comments.
mlir/include/mlir/IR/OpDefinition.h
112–118

I'd rather move the const_cast to a raw_ostream specific method, so that const doesn't seep into the core classes. Is that possible?

This revision is now accepted and ready to land.Oct 11 2021, 10:43 AM

Applied review remark and reverted unnecessary format changes

This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.Oct 28 2021, 8:51 PM
mlir/unittests/IR/OperationSupportTest.cpp
222

This is leaky: https://lab.llvm.org/staging/#/builders/191/builds/350

Can you make sure to destroy it?

vinograd47 marked an inline comment as done.Oct 29 2021, 5:24 AM
vinograd47 added inline comments.