[clang] [clang-bindings] Add strict typing to clang Python bindings (#76664) (PR #78114)

Jannick Kremer via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 14 14:00:22 PST 2024


================
@@ -1722,23 +2300,23 @@ def location(self):
         return self._loc
 
     @property
-    def linkage(self):
+    def linkage(self) -> LinkageKind:
         """Return the linkage of this cursor."""
         if not hasattr(self, "_linkage"):
             self._linkage = conf.lib.clang_getCursorLinkage(self)
 
         return LinkageKind.from_id(self._linkage)
 
     @property
-    def tls_kind(self):
+    def tls_kind(self) -> TLSKind:
         """Return the thread-local storage (TLS) kind of this cursor."""
         if not hasattr(self, "_tls_kind"):
             self._tls_kind = conf.lib.clang_getCursorTLSKind(self)
----------------
DeinAlptraum wrote:

The `conf.lib.clang_getCursorTLSKind()` call leads to segmentation faults on my system (even before I changed anything) so I wasn't able to test this.

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


More information about the cfe-commits mailing list