[clang] [alpha.webkit.UncountedCallArgsChecker] Use canonical type (PR #109393)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 14:07:42 PDT 2024


================
@@ -102,12 +102,13 @@ class UncountedCallArgsChecker
         // if ((*P)->hasAttr<SafeRefCntblRawPtrAttr>())
         //  continue;
 
-        const auto *ArgType = (*P)->getType().getTypePtrOrNull();
-        if (!ArgType)
+        QualType ArgType = (*P)->getType().getCanonicalType();
+        const auto *TypePtr = ArgType.getTypePtrOrNull();
----------------
haoNoQ wrote:

`getTypePtrOrNull()` is unnecessary most of the time because you can do all the same operations on `QualType` directly, thanks to the overloaded `QualType::operator->()`.

I think `isUncountedPtr()` should simply accept a `QualType` directly.

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


More information about the cfe-commits mailing list