[llvm] [LangRef] Clarify to exclude norecurse attribute when any call paths through external functions is present (PR #157087)

Usha Gupta via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 05:08:18 PDT 2025


https://github.com/usha1830 updated https://github.com/llvm/llvm-project/pull/157087

>From 6df0f1de81997edbf47c2fbc5407975e600d03f5 Mon Sep 17 00:00:00 2001
From: Usha Gupta <usha.gupta at arm.com>
Date: Fri, 5 Sep 2025 11:50:55 +0000
Subject: [PATCH] [LangRef] Clarify to exclude norecurse attribute when any
 call path through external functions is present.

---
 llvm/docs/LangRef.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index e64b9343b7622..787592a85971e 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -2256,9 +2256,12 @@ For example:
     behavior at runtime if the function ever does dynamically return. Annotated
     functions may still raise an exception, i.a., ``nounwind`` is not implied.
 ``norecurse``
-    This function attribute indicates that the function does not call itself
-    either directly or indirectly down any possible call path. This produces
-    undefined behavior at runtime if the function ever does recurse.
+    This function attribute indicates that the function does not participate in
+    recursion, either directly or through mutual recursion. At runtime it is
+    undefined behavior if any dynamic call stack contains this function more
+    than once at the same time. A function must not be marked ``norecurse`` if,
+    along any call path starting from its body, control may reach an external
+    function whose definition is not available.
 
 .. _langref_willreturn:
 



More information about the llvm-commits mailing list