[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

Florian Mayer via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 28 12:56:43 PDT 2025


================
@@ -164,16 +161,19 @@ ast_matchers::StatementMatcher isPointerLikeOperatorArrow() {
                            ofClass(pointerClass()))));
 }
 
-ast_matchers::StatementMatcher isSmartPointerLikeValueMethodCall() {
+ast_matchers::StatementMatcher
+isSmartPointerLikeValueMethodCall(clang::StringRef MethodName) {
   return cxxMemberCallExpr(callee(cxxMethodDecl(
       parameterCountIs(0), returns(hasCanonicalType(referenceType())),
-      hasName("value"), ofClass(smartPointerClassWithValue()))));
+      hasName(MethodName),
----------------
fmayer wrote:

The short-term plan is to use this for a data type that uses `Get` instead of `get` but otherwise models a smartpointerlike.

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


More information about the cfe-commits mailing list