[clang] [libclang/python] Add isFunctionInlined support (PR #162882)

Thomas Applencourt via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 10 09:49:48 PDT 2025


https://github.com/TApplencourt updated https://github.com/llvm/llvm-project/pull/162882

>From 674bdfb5d0160bf637cce069fdf03c465c81b287 Mon Sep 17 00:00:00 2001
From: tapplencourt <tapplencourt at anl.gov>
Date: Fri, 10 Oct 2025 16:39:51 +0000
Subject: [PATCH 1/2] Add isFunctionInlined support in Python Binding

---
 clang/bindings/python/clang/cindex.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 80140d2787608..015667b4decd9 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -2362,6 +2362,13 @@ def get_bitfield_width(self) -> int:
         """
         return conf.lib.clang_getFieldDeclBitWidth(self)  # type: ignore [no-any-return]
 
+    def is_function_inlined(self) -> bool:
+        """
+        Check if the function is inlined
+        """
+        assert self.kind == TypeKind.FUNCTIONPROTO
+        return bool(conf.lib.clang_Cursor_isFunctionInlined(self))  # type: ignore [no-any-return]
+
     @cursor_null_guard
     def has_attrs(self) -> bool:
         """
@@ -4308,6 +4315,7 @@ def set_property(self, property, value):
     ("clang_Cursor_isAnonymous", [Cursor], bool),
     ("clang_Cursor_isAnonymousRecordDecl", [Cursor], bool),
     ("clang_Cursor_isBitField", [Cursor], bool),
+    ("clang_Cursor_isFunctionInlined", [Cursor], c_uint),
     ("clang_Location_isInSystemHeader", [SourceLocation], bool),
     ("clang_PrintingPolicy_dispose", [PrintingPolicy]),
     ("clang_PrintingPolicy_getProperty", [PrintingPolicy, c_int], c_uint),

>From 1300ae39e26309f9e64971a616d3690436b13631 Mon Sep 17 00:00:00 2001
From: tapplencourt <tapplencourt at anl.gov>
Date: Fri, 10 Oct 2025 16:39:51 +0000
Subject: [PATCH 2/2] Add isFunctionInlined support in Python Binding

---
 clang/bindings/python/clang/cindex.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 015667b4decd9..99ca72fccc26f 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -2369,6 +2369,14 @@ def is_function_inlined(self) -> bool:
         assert self.kind == TypeKind.FUNCTIONPROTO
         return bool(conf.lib.clang_Cursor_isFunctionInlined(self))  # type: ignore [no-any-return]
 
+    @cursor_null_guard
+    def is_function_inlined(self) -> bool:
+        """
+        Check if the function is inlined
+        """
+        assert self.kind == TypeKind.FUNCTIONPROTO
+        return bool(conf.lib.clang_Cursor_isFunctionInlined(self))  # type: ignore [no-any-return]
+
     @cursor_null_guard
     def has_attrs(self) -> bool:
         """



More information about the cfe-commits mailing list