[llvm-branch-commits] [clang] e75fec2 - [AttrDocs] document always_inline
Nick Desaulniers via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 17 12:39:42 PST 2020
Author: Nick Desaulniers
Date: 2020-12-17T12:34:23-08:00
New Revision: e75fec2b238f0e26cfb7645f2208baebe3440d41
URL: https://github.com/llvm/llvm-project/commit/e75fec2b238f0e26cfb7645f2208baebe3440d41
DIFF: https://github.com/llvm/llvm-project/commit/e75fec2b238f0e26cfb7645f2208baebe3440d41.diff
LOG: [AttrDocs] document always_inline
GNU documentaion for always_inline:
https://gcc.gnu.org/onlinedocs/gcc/Inline.html
GNU documentation for function attributes:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
Microsoft documentation for __force_inline:
https://docs.microsoft.com/en-us/cpp/cpp/inline-functions-cpp
Reviewed By: ojeda
Differential Revision: https://reviews.llvm.org/D68410
Added:
Modified:
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index ce2ee40dc036e..ba6c459f4a431 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -684,7 +684,7 @@ def AlignMac68k : InheritableAttr {
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
index c3a412158aba0..6f47ca505b5e0 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -5653,3 +5653,22 @@ Requirements on Development Tools - Engineering Specification Documentation
<https://developer.arm.com/docs/ecm0359818/latest/>`_ 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";
+}
More information about the llvm-branch-commits
mailing list