================
@@ -56,6 +60,25 @@ getImplicitObjectParamLifetimeBoundAttr(const FunctionDecl 
*FD);
 /// method or because it's a normal assignment operator.
 bool implicitObjectParamIsLifetimeBound(const FunctionDecl *FD);
 
+using LifetimeBoundParamInfo =
+    llvm::PointerUnion<const ParmVarDecl *, const CXXMethodDecl *>;
+
+/// Returns the callee and arguments corresponding to Call. For instance member
+/// calls, Args includes the implicit object argument as argument 0.
+std::pair<const FunctionDecl *, llvm::SmallVector<const Expr *, 4>>
+getFunctionCallInfo(const Expr *Call);
+
+/// Returns the parameter corresponding to argument I when the argument should
+/// be tracked for lifetime safety.
+std::optional<LifetimeBoundParamInfo>
+getTrackedArgInfo(const FunctionDecl *FD, llvm::ArrayRef<const Expr *> Args,
----------------
iitianpushkar wrote:

If you meant `getTrackedArgInfo` and `getTrackingInfoForCallArg`, then yes, I 
think both are needed.

`FactsGenerator` already has the arg index, so it calls `getTrackedArgInfo` 
directly. The diagnostic path only has expressions, so 
`getTrackingInfoForCallArg` recovers the arg first and then calls 
`getTrackedArgInfo`.

https://github.com/llvm/llvm-project/pull/206337
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to