[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
thomaswucher wrote: Thanks for all your reviews and comments, very much appreciated! I will update this PR once https://github.com/llvm/llvm-project/pull/95608 has been merged. https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
thomaswucher wrote: Thanks for your note @Endilll! I've rebased my changes to the latest main branch. Could you give this a review? Thanks in advance! https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
@@ -1820,6 +1820,18 @@ def availability(self): return AvailabilityKind.from_id(self._availability) +@property +def binary_operator(self): +""" +Retrieves the opcode if this cursor points to a binary operator +:return: +""" + +if not hasattr(self, "_binopcode"): +self._binopcode = conf.lib.clang_Cursor_getBinaryOpcode(self) thomaswucher wrote: Good point, you are probably right, thank you! There is also an `__all__` list at the bottom of `cindex.py` listing, among others, all enumeration classes defined in `cindex.py`. Probably the new `BinaryOperator` class should be added there as well? I'm currently running the tests locally. https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
https://github.com/thomaswucher edited https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
@@ -1820,6 +1820,18 @@ def availability(self): return AvailabilityKind.from_id(self._availability) +@property +def binary_operator(self): +""" +Retrieves the opcode if this cursor points to a binary operator +:return: +""" + +if not hasattr(self, "_binopcode"): +self._binopcode = conf.lib.clang_Cursor_getBinaryOpcode(self) thomaswucher wrote: Thanks for your review and explanation! I've just pushed a new version, addressing both issues. https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
thomaswucher wrote: Thank you for your approval, @DeinAlptraum! @AaronBallman and @Endilll, is there anything else I need to do to get this merged? Would one of you be so kind to approve the remaining GitHub workflows? Thanks for all your support and quick responses! https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Retrieve BinaryOperator::getOpcode and BinaryOperator::getOpcodeStr via libclang and its python interface (PR #98489)
@@ -54,6 +54,8 @@ LLVM_13 { clang_Cursor_Evaluate; clang_Cursor_getArgument; clang_Cursor_getBriefCommentText; +clang_Cursor_getBinaryOpcode; +clang_Cursor_getBinaryOpcodeStr; thomaswucher wrote: I must have missed this when rebasing the patch, sorry. If it needs to be fixed I can of course provide a follow up pull request next week. https://github.com/llvm/llvm-project/pull/98489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits