-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[libclang/python] Add isFunctionInlined support #162882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang Author: Thomas Applencourt (TApplencourt) Changes
I was not able to figure out why Regards, Full diff: https://github.com/llvm/llvm-project/pull/162882.diff 1 Files Affected:
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),
|
Pinging @DeinAlptraum (or at least the git blame seem to imply that you are the one in charge :) sorry if it's not the case) |
1300ae3
to
7a69e7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi and thanks for the PR! Yes, I am the right person to ping for the libclang-python bindings.
Please also
- Add a release note (
clang/docs/ReleaseNotes.rst
) - Add test(s) for the new function
Release note added in 6edd33c |
LGTM. @Endilll do you also want to take a look at this? |
cindex.py
was missing support for isFunctionInlined.I was not able to figure out why
clang_Cursor_isFunctionInlined
returnc_uint
, but otheris
function returnbool
for the binding, so I'm doing the same here.Regards,
Thomas