This is an archive of the discontinued LLVM Phabricator instance.

[NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h
ClosedPublic

Authored by DanielMcIntosh-IBM on Aug 17 2021, 12:03 PM.

Details

Summary

I'm about to submit a change which involves re-writing most of
cxa_guard_impl.h. Running clang-format on the whole file first seems like a
good idea.

Diff Detail

Event Timeline

DanielMcIntosh-IBM requested review of this revision.Aug 17 2021, 12:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 12:03 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Aug 17 2021, 3:22 PM

I'd normally frown upon this since we generally don't clang-format whole files at once, but since the changes are pretty small, it might be OK to do that. But we definitely want to clang-format it right though.

libcxxabi/src/cxa_guard_impl.h
44–47

We definitely want to tweak our clang-format configuration such that nested #ifs are indented. It's really difficult to read otherwise (kind of like if we did not indent regular nested if (...) statements).

133

The line length here is 80, but we use 120 in libc++ unless I'm mistaken. I think we should be using the same configuration for libc++ and libc++abi.

This revision now requires changes to proceed.Aug 17 2021, 3:22 PM
DanielMcIntosh-IBM edited the summary of this revision. (Show Details)Aug 18 2021, 8:10 AM

Address Louis's comments

DanielMcIntosh-IBM marked 2 inline comments as done.Aug 18 2021, 8:55 AM

I'd normally frown upon this since we generally don't clang-format whole files at once, but since the changes are pretty small, it might be OK to do that. But we definitely want to clang-format it right though.

I know we're supposed to make the whitespace/formatting changes "highly localized" to the area we're about to make changes to, but since I'm going to be making changes to %80 of the file anyways, leaving the nonconformant formatting in the remaining %20 felt rather silly. Was this the wrong decision? Is there ever a situation where running clang-format on a whole file like this is recommend?

ldionne accepted this revision.Aug 18 2021, 1:47 PM

LGTM, but just for anyone watching, don't consider this as setting precedent for clang-formating full files arbitrarily. We normally don't do this, but since the author is going to almost rewrite the file, this seems somewhat more reasonable.

This revision is now accepted and ready to land.Aug 18 2021, 1:47 PM

Also, consider dropping [SystemZ][z/OS] from the commit message since it has nothing to do with those -- those tags are useful insofar as they are used only when a commit is really related to the tags, otherwise they lose their power.

DanielMcIntosh-IBM retitled this revision from [NFC][SystemZ][z/OS] Run clang-format on libcxxabi/src/cxa_guard_impl.h to [NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h.Aug 18 2021, 4:03 PM
DanielMcIntosh-IBM retitled this revision from [NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h to [NFC][SystemZ][z/OS] Run clang-format on libcxxabi/src/cxa_guard_impl.h.

Update commit tags

DanielMcIntosh-IBM retitled this revision from [NFC][SystemZ][z/OS] Run clang-format on libcxxabi/src/cxa_guard_impl.h to [NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h.Aug 18 2021, 4:04 PM
This revision was landed with ongoing or failed builds.Aug 18 2021, 4:09 PM
This revision was automatically updated to reflect the committed changes.