Page MenuHomePhabricator

[flang] Clean up file formats
Needs ReviewPublic

Authored by PeteSteinfeld on May 13 2021, 10:52 AM.

Details

Summary

The latest version of clang-format that gets built from LLVM has changed its
behavior. I built the latest version and ran it on all of the .h and .cpp
files in the include, lib, module, runtime, and tools directories. I then
built and tested the resulting compiler, and everything seemed to work.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.May 13 2021, 10:52 AM
PeteSteinfeld requested review of this revision.May 13 2021, 10:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2021, 10:52 AM
PeteSteinfeld added a project: Restricted Project.
schweitz added inline comments.May 13 2021, 11:05 AM
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
66 ↗(On Diff #345216)

Does this change the doxygen produced?

PeteSteinfeld added inline comments.May 13 2021, 12:39 PM
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
66 ↗(On Diff #345216)

I have no idea. How do I check?

Thanks, @sscalpone. When I try to follow those instructions, I get a message about the doxygen executable being missing. I'm working on sky7. What's the best way to get doxygen installed?

@PeteSteinfeld , many thanks for this patch!

LGTM, though I think it is worth waiting to see how https://github.com/google/llvm-premerge-checks/issues/303 is resolved. Also, perhaps this should be formatted with clang-format-12 instead of ToT? Given that LLVM 12 has just been released, I suspect that the the results will be (almost) identical. I'm suggesting this as we won't be getting anything more recent than clang-format-12 in LLVM's pre-merge checks any time soon (not until LLVM 13 is released).

flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
66 ↗(On Diff #345216)

AFAIK, it does not. Doxygen would require \n to force a newline here (see the docs).

Just to be on the safe side, I checked what happens elsewhere in LLVM:

  • comments in source code spanning multiple lines: link
  • generated Doxygen: link

Thanks for your comments, @awarzynski. The version of clang-format that I build from the latest sources is 13.0.0. I've been in the habit of the last many months to always use the latest version of clang-format, but I'm not sure if there's general agreement on that policy. I'll post a message on the mailing list about this.

I removed changes to flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp, since it looks like they will cause problems for Doxygen, and I can't currently test for them.