[clang] [libclang/python] Fold CCRStructure into CodeCompletionResults (PR #224678)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 01:27:34 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:

> 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)

Sorry, this is not true. What happened is that many of them folded into base classes `BaseEnumeration` and `ClangObject`.

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


More information about the cfe-commits mailing list