OfekShilon created this revision. OfekShilon added reviewers: xur, davidxl. Herald added a reviewer: aaron.ballman. Herald added a project: All. OfekShilon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Following this <https://reviews.llvm.org/D92493>, add docs for the hot/cold function attributes Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D130933 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td Index: clang/include/clang/Basic/AttrDocs.td =================================================================== --- clang/include/clang/Basic/AttrDocs.td +++ clang/include/clang/Basic/AttrDocs.td @@ -5241,6 +5241,22 @@ }]; } +def HotFunctionEntryDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +``__attribute__((hot))`` marks a function as hot, as a manual alternative to PGO hotness data. +In case PGO data is available too user annotated ``__attribute__((hot))`` overwrites profile count based hotness (unlike ``__attribute__((cold))``). +}]; +} + +def ColdFunctionEntryDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +``__attribute__((cold))`` marks a function as cold, as a manual alternative to PGO hotness data. +In case PGO data is available too profile count based hotness overwrites user annotated ``__attribute__((cold))`` (unlike ``__attribute__((hot))``). +}]; +} + def TransparentUnionDocs : Documentation { let Category = DocCatDecl; let Content = [{ Index: clang/include/clang/Basic/Attr.td =================================================================== --- clang/include/clang/Basic/Attr.td +++ clang/include/clang/Basic/Attr.td @@ -1073,8 +1073,7 @@ def Cold : InheritableAttr { let Spellings = [GCC<"cold">]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; - let SimpleHandler = 1; + let Documentation = [ColdFunctionEntryDocs]; } def Common : InheritableAttr { @@ -1519,8 +1518,7 @@ def Hot : InheritableAttr { let Spellings = [GCC<"hot">]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; - let SimpleHandler = 1; + let Documentation = [HotFunctionEntryDocs]; } def : MutualExclusions<[Hot, Cold]>;
Index: clang/include/clang/Basic/AttrDocs.td =================================================================== --- clang/include/clang/Basic/AttrDocs.td +++ clang/include/clang/Basic/AttrDocs.td @@ -5241,6 +5241,22 @@ }]; } +def HotFunctionEntryDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +``__attribute__((hot))`` marks a function as hot, as a manual alternative to PGO hotness data. +In case PGO data is available too user annotated ``__attribute__((hot))`` overwrites profile count based hotness (unlike ``__attribute__((cold))``). +}]; +} + +def ColdFunctionEntryDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +``__attribute__((cold))`` marks a function as cold, as a manual alternative to PGO hotness data. +In case PGO data is available too profile count based hotness overwrites user annotated ``__attribute__((cold))`` (unlike ``__attribute__((hot))``). +}]; +} + def TransparentUnionDocs : Documentation { let Category = DocCatDecl; let Content = [{ Index: clang/include/clang/Basic/Attr.td =================================================================== --- clang/include/clang/Basic/Attr.td +++ clang/include/clang/Basic/Attr.td @@ -1073,8 +1073,7 @@ def Cold : InheritableAttr { let Spellings = [GCC<"cold">]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; - let SimpleHandler = 1; + let Documentation = [ColdFunctionEntryDocs]; } def Common : InheritableAttr { @@ -1519,8 +1518,7 @@ def Hot : InheritableAttr { let Spellings = [GCC<"hot">]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; - let SimpleHandler = 1; + let Documentation = [HotFunctionEntryDocs]; } def : MutualExclusions<[Hot, Cold]>;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits