[clang] Add retrieval of unary operator spelling and python bindings (PR #219983)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 01:23:19 PDT 2026


================
@@ -2036,6 +2036,19 @@ def binary_operator(self) -> BinaryOperator:
 
         return BinaryOperator.from_id(self._binopcode)
 
+    @property
+    @cursor_null_guard
+    def unary_operator(self) -> UnaryOperator:
+        """
+        Retrieves the opcode if this cursor points to a unary operator
+        :return:
----------------
ItsRumo wrote:

Another oddity of the binary operator and not present anywhere else in the `cindex.py`. I have removed it.

https://github.com/llvm/llvm-project/pull/219983


More information about the cfe-commits mailing list