This is an archive of the discontinued LLVM Phabricator instance.

Sort Attributes by "HeaderName"
ClosedPublic

Authored by erichkeane on Oct 16 2017, 12:14 PM.

Details

Summary

Attributes in the docs were previously sorted (apparently)
by the attribute name, so AnyX86Interrupt ended up being the
first one, rather than in a meaningful place. This resulted in the
4 'interrupt' titled sections being all in different places.

This replaces it with a naive alphabetical sort (case sensitive, underscore
and special characters first, etc).

Diff Detail

Repository
rL LLVM

Event Timeline

erichkeane created this revision.Oct 16 2017, 12:14 PM

Additionally, I'm going to edit the 'interrupt' docs in a separate commit to give each a separate header name based on the architecture. Currently they are all named 'interrupt', so I want to rename them all interrupt (x86), etc. Look for a future review!

utils/TableGen/ClangAttrEmitter.cpp
3666 ↗(On Diff #119192)

These two cannot be 'const', otherwise operator= is suppressed. Thus, std::sort won't work (Requires ValueSwappable).

3865 ↗(On Diff #119192)

Had to remove const, since the sort actually modifies the map.

erichkeane added inline comments.Oct 16 2017, 12:30 PM
utils/TableGen/ClangAttrEmitter.cpp
3670 ↗(On Diff #119192)

Craig brought up that I could just take by value and move out of 'first', which is more flexible for usage. New patch incoming once it passes a build.

Change the constructor in DocumentationData to take by value.

aaron.ballman accepted this revision.Oct 16 2017, 1:29 PM

LGTM, thank you!

This revision is now accepted and ready to land.Oct 16 2017, 1:29 PM
This revision was automatically updated to reflect the committed changes.