[llvm] 22f635b - [LangRef] update according to unwinding support in inline asm

Amanieu d'Antras via llvm-commits llvm-commits at lists.llvm.org
Mon May 31 01:02:52 PDT 2021


Author: cynecx
Date: 2021-05-31T09:01:46+01:00
New Revision: 22f635b1b31a6bee1b0b8df58d5c8207c835b216

URL: https://github.com/llvm/llvm-project/commit/22f635b1b31a6bee1b0b8df58d5c8207c835b216
DIFF: https://github.com/llvm/llvm-project/commit/22f635b1b31a6bee1b0b8df58d5c8207c835b216.diff

LOG: [LangRef] update according to unwinding support in inline asm

https://reviews.llvm.org/D95745 introduced a new `unwind` keyword for inline assembler expressions. Inline asms marked with the `unwind` keyword allows stack unwinding from inline assembly because the compiler emits unwinding information ("around" the inline asm) as it would for calls/invokes. Unwinding the stack from within non-unwind inline asm may cause UB.

Reviewed By: Amanieu

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

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 6d6c72cbb66b..0dc0b53925d8 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -4303,9 +4303,20 @@ the only supported dialects. An example is:
 
     call void asm inteldialect "eieio", ""()
 
-If multiple keywords appear the '``sideeffect``' keyword must come
-first, the '``alignstack``' keyword second and the '``inteldialect``'
-keyword last.
+In the case that the inline asm might unwind the stack,
+the '``unwind``' keyword must be used, so that the compiler emits
+unwinding information:
+
+.. code-block:: llvm
+
+    call void asm unwind "call func", ""()
+
+If the inline asm unwinds the stack and isn't marked with
+the '``unwind``' keyword, the behavior is undefined.
+
+If multiple keywords appear, the '``sideeffect``' keyword must come
+first, the '``alignstack``' keyword second, the '``inteldialect``' keyword
+third and the '``unwind``' keyword last.
 
 Inline Asm Constraint String
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^


        


More information about the llvm-commits mailing list