This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Don't break block comments when sorting includes.
ClosedPublic

Authored by curdeius on Jan 31 2022, 9:40 AM.

Details

Summary

Fixes https://github.com/llvm/llvm-project/issues/34626.

Before, the include sorter would break the code:

#include <stdio.h>
#include <stdint.h> /* long
                       comment */

and change it into:

#include <stdint.h> /* long
#include <stdio.h>
                       comment */

This commit handles only the most basic case of a single block comment on an include line, but does not try to handle all the possible edge cases with multiple comments.

Diff Detail

Event Timeline

curdeius requested review of this revision.Jan 31 2022, 9:40 AM
curdeius created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2022, 9:40 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius retitled this revision from [clang-format] Don't break block comments when sorting include. to [clang-format] Don't break block comments when sorting includes..Jan 31 2022, 9:40 AM
curdeius added a project: Restricted Project.
curdeius updated this revision to Diff 404581.Jan 31 2022, 9:42 AM

Remove commented code. NFC.

This revision is now accepted and ready to land.Jan 31 2022, 11:33 AM
This revision was landed with ongoing or failed builds.Jan 31 2022, 11:51 PM
This revision was automatically updated to reflect the committed changes.