================
@@ -60,6 +60,14 @@ class LifetimeSafetyReporter {
virtual void suggestAnnotation(SuggestionScope Scope,
const ParmVarDecl *ParmToAnnotate,
const Expr *EscapeExpr) {}
+
+ // Suggests lifetime bound annotations for implicit this
+ virtual void suggestAnnotation(SuggestionScope Scope, const CXXMethodDecl
*MD,
+ const Expr *EscapeExpr) {}
+
+ // Adds inferred lifetime bound attribute for implicit this to its
+ // TypeSourceInfo
+ virtual void addLifetimeBoundToImplicitThis(const CXXMethodDecl *MD) {}
----------------
kashika0112 wrote:
The implementation of addLifetimeBoundToImplicitThis requires modifying the
TSI, which is done using the TypeLocBuilder utility. TypeLocBuilder is an
internal header within libSema and is not exposed to libAnalysis. I added this
function in LifetimeSafetyReporter as it already holds a reference to Sema.
One way I can think of is move the actual implementation of this TSI
transformation to a static helper in SemaDecl.cpp or keep it as a private
helper in AnalysisBasedWarnings.cpp. Let me know which is more suitable here.
https://github.com/llvm/llvm-project/pull/176703
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits