[clang] [libclang/python] Fold CCRStructure into CodeCompletionResults (PR #224678)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 6 01:15:07 PDT 2026
================
@@ -3216,38 +3216,20 @@ def __getitem__(self, key: int) -> CodeCompletionResult:
return self.results[key]
-class CodeCompletionResults(ClangObject):
- def __init__(self, ptr: _Pointer[CCRStructure]):
- assert isinstance(ptr, POINTER(CCRStructure)) and ptr
- self.ptr = self._as_parameter_ = ptr
-
- def from_param(self) -> _Pointer[CCRStructure]:
- return self._as_parameter_
----------------
Endilll wrote:
This made more sense before this PR, because `CodeCompletionResults` wasn't a `Structure`. With this PR, I generally agree that we want to avoid `from_param` magic, as we've done in many other places (we used to have more that 20 of them several years ago). The only thing that gives me pause is the fact that the ability (and necessity) to call `byref` on the instances of `CodeCompletionResults` to call a handful of functions that take it is an API in itself, but IIRC using high-level objects to call low-level C functions is not (yet) a part of advertised cindex features, so I guess we're fine.
https://github.com/llvm/llvm-project/pull/224678
More information about the cfe-commits
mailing list