diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -678,7 +678,7 @@ def AlwaysInline : InheritableAttr { let Spellings = [GCC<"always_inline">, Keyword<"__forceinline">]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; + let Documentation = [AlwaysInlineDocs]; } def Artificial : InheritableAttr { diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -5486,3 +5486,22 @@ `_ for more information. }]; } + +def AlwaysInlineDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Inlining heuristics are disabled and inlining is always attempted regardless of +optimization level. + +Does not guarantee that inline substitution actually occurs. + +See also `the Microsoft Docs on Inline Functions`_, `the GCC Common Function +Attribute docs`_, and `the GCC Inline docs`_. + +.. _the Microsoft Docs on Inline Functions: https://docs.microsoft.com/en-us/cpp/cpp/inline-functions-cpp +.. _the GCC Common Function Attribute docs: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html +.. _the GCC Inline docs: https://gcc.gnu.org/onlinedocs/gcc/Inline.html + +}]; + let Heading = "always_inline, __force_inline"; +}