diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -4433,7 +4433,13 @@ // Gather the Documentation lists from each of the attributes, based on the // category provided. std::vector Attrs = Records.getAllDerivedDefinitions("Attr"); - std::map> SplitDocs; + struct CategoryLess { + bool operator()(const Record *L, const Record *R) const { + return L->getValueAsString("Name") < R->getValueAsString("Name"); + } + }; + std::map, CategoryLess> + SplitDocs; for (const auto *A : Attrs) { const Record &Attr = *A; std::vector Docs = Attr.getValueAsListOfDefs("Documentation");