This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Ignore case and stable sort using-declarations
ClosedPublic

Authored by krasimir on Aug 29 2017, 7:38 AM.

Details

Summary

This ignores case while sorting using-declarations, fixing a case where _ would appear between lowercase and uppercase characters.
It also applies stable sort, so that replacements for the exact same using declarations are not generated.

Event Timeline

krasimir created this revision.Aug 29 2017, 7:38 AM
krasimir updated this revision to Diff 113092.Aug 29 2017, 7:40 AM
  • Actually add a test
alexfh edited edge metadata.Sep 19 2017, 3:30 AM

As discussed offline, the sorting should also be stable to avoid no-op replacements for identical using declarations and randomizing the order of using declarations differing only in case (not that I'd expect this to be a frequent thing, but it's better to handle it properly anyway).

krasimir updated this revision to Diff 115998.Sep 20 2017, 7:36 AM
  • Stable sort using declarations
krasimir retitled this revision from [clang-format] Ignore case when sorting using-declarations to [clang-format] Ignore case and stable sort using-declarations.Sep 20 2017, 7:38 AM
krasimir edited the summary of this revision. (Show Details)
alexfh accepted this revision.Sep 21 2017, 7:50 AM

LG, thanks!

This revision is now accepted and ready to land.Sep 21 2017, 7:50 AM
This revision was automatically updated to reflect the committed changes.