This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Sort using-declarations case sensitively with a special case for '_'
ClosedPublic

Authored by krasimir on Nov 2 2017, 6:48 AM.

Details

Summary

This makes clang-format sort using declarations case-sensitive with the
exception that '_' comes just before 'A'. This is better than the current case
insensitive version, because it groups uppercase names in the same namespace
together.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Nov 2 2017, 6:48 AM
krasimir added a subscriber: cfe-commits.
bkramer edited edge metadata.Nov 2 2017, 10:25 AM

Can we just write out the modified string comparison function instead of keeping both versions of the string around in memory? I'd prefer less state.

krasimir updated this revision to Diff 121465.Nov 3 2017, 6:02 AM
  • Remove SortLabel

How about this trade-off? I don't really want to re-implement comparison (it makes the code harder to read), so I replaced the state with an explicit computation.

krasimir updated this revision to Diff 121475.Nov 3 2017, 7:32 AM
  • Address review comment
bkramer accepted this revision.Nov 3 2017, 7:35 AM

lg, thanks!

This revision is now accepted and ready to land.Nov 3 2017, 7:35 AM
This revision was automatically updated to reflect the committed changes.