This is an archive of the discontinued LLVM Phabricator instance.

[mlir] omit extra newlines if there are no aliases
AcceptedPublic

Authored by matthiaskramm on Apr 17 2020, 9:57 AM.

Details

Reviewers
rriddle
Summary

We used to always print an extra newline after every kindAlias
group, even if the groups were empty. This is now omitted. In
particular, an empty module is now printed as "module {\n}", not
"\n\nmodule {\n}".

Diff Detail

Event Timeline

matthiaskramm created this revision.Apr 17 2020, 9:57 AM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle accepted this revision.Apr 17 2020, 10:08 AM
rriddle added inline comments.
mlir/lib/IR/AsmPrinter.cpp
388

nit:

if (aliasAttrsPair.second.empty())
  continue;
This revision is now accepted and ready to land.Apr 17 2020, 10:08 AM

Use 'continue' instead of 'if'.

matthiaskramm marked an inline comment as done.Apr 17 2020, 10:27 AM