[llvm-branch-commits] [llvm] 7807411 - [LangRef] Update new ssp/sspstrong/sspreq semantics after D91816

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 17 09:20:55 PST 2020


Author: Fangrui Song
Date: 2020-12-17T09:16:37-08:00
New Revision: 780741107e6f2009dcc22a18b8976bf2f2efbeba

URL: https://github.com/llvm/llvm-project/commit/780741107e6f2009dcc22a18b8976bf2f2efbeba
DIFF: https://github.com/llvm/llvm-project/commit/780741107e6f2009dcc22a18b8976bf2f2efbeba.diff

LOG: [LangRef] Update new ssp/sspstrong/sspreq semantics after D91816

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D93422

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cde9ed519626..9ba6a21d08c2 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1840,13 +1840,20 @@ example:
     Variables that are identified as requiring a protector will be arranged
     on the stack such that they are adjacent to the stack protector guard.
 
-    If a function that has an ``ssp`` attribute is inlined into a
-    function that doesn't have an ``ssp`` attribute, then the resulting
-    function will have an ``ssp`` attribute.
-``sspreq``
-    This attribute indicates that the function should *always* emit a
-    stack smashing protector. This overrides the ``ssp`` function
-    attribute.
+    A function with the ``ssp`` attribute but without the ``alwaysinline``
+    attribute cannot be inlined into a function without a
+    ``ssp/sspreq/sspstrong`` attribute. If inlined, the caller will get the
+    ``ssp`` attribute.
+``sspstrong``
+    This attribute indicates that the function should emit a stack smashing
+    protector. This attribute causes a strong heuristic to be used when
+    determining if a function needs stack protectors. The strong heuristic
+    will enable protectors for functions with:
+
+    - Arrays of any size and type
+    - Aggregates containing an array of any size and type.
+    - Calls to alloca().
+    - Local variables that have had their address taken.
 
     Variables that are identified as requiring a protector will be arranged
     on the stack such that they are adjacent to the stack protector guard.
@@ -1859,20 +1866,16 @@ example:
     #. Variables that have had their address taken are 3rd closest to the
        protector.
 
-    If a function that has an ``sspreq`` attribute is inlined into a
-    function that doesn't have an ``sspreq`` attribute or which has an
-    ``ssp`` or ``sspstrong`` attribute, then the resulting function will have
-    an ``sspreq`` attribute.
-``sspstrong``
-    This attribute indicates that the function should emit a stack smashing
-    protector. This attribute causes a strong heuristic to be used when
-    determining if a function needs stack protectors. The strong heuristic
-    will enable protectors for functions with:
+    This overrides the ``ssp`` function attribute.
 
-    - Arrays of any size and type
-    - Aggregates containing an array of any size and type.
-    - Calls to alloca().
-    - Local variables that have had their address taken.
+    A function with the ``sspstrong`` attribute but without the
+    ``alwaysinline`` attribute cannot be inlined into a function without a
+    ``ssp/sspstrong/sspreq`` attribute. If inlined, the caller will get the
+    ``sspstrong`` attribute unless the ``sspreq`` attribute exists.
+``sspreq``
+    This attribute indicates that the function should *always* emit a stack
+    smashing protector. This overrides the ``ssp`` and ``sspstrong`` function
+    attributes.
 
     Variables that are identified as requiring a protector will be arranged
     on the stack such that they are adjacent to the stack protector guard.
@@ -1885,11 +1888,11 @@ example:
     #. Variables that have had their address taken are 3rd closest to the
        protector.
 
-    This overrides the ``ssp`` function attribute.
+    A function with the ``sspreq`` attribute but without the ``alwaysinline``
+    attribute cannot be inlined into a function without a
+    ``ssp/sspstrong/sspreq`` attribute. If inlined, the caller will get the
+    ``sspreq`` attribute.
 
-    If a function that has an ``sspstrong`` attribute is inlined into a
-    function that doesn't have an ``sspstrong`` attribute, then the
-    resulting function will have an ``sspstrong`` attribute.
 ``strictfp``
     This attribute indicates that the function was called from a scope that
     requires strict floating-point semantics.  LLVM will not attempt any


        


More information about the llvm-branch-commits mailing list