================
@@ -160,6 +162,19 @@ class LifetimeChecker {
     for (const auto &[PVD, EscapeExpr] : AnnotationWarningsMap)
       Reporter->suggestAnnotation(PVD, EscapeExpr);
   }
+
+  void inferAnnotations() {
+    /// NOTE: This currently only adds the attribute to the function definition
+    /// being analyzed. For full inter-procedural inference to work reliably
+    /// (e.g., with out-of-order definitions), this attribute would also need 
to
+    /// be added to all other redeclarations of the function.
----------------
usx95 wrote:

I would skip mentioning inter-procedural inference as a single clang invocation 
can never achieve this. I would just mention the function analysis order for 
best results.

`// FIXME: To maximise inference propagation, functions should be analyzed in 
post-order of the call hierarchy, allowing inferred annotations to propagate 
through the call chain.`

For issue with redecl, I think we should have a separate fixme:  
`// FIXME: Add the inferred attribute to all redeclarations of the function, 
not just the definition being analyzed.`

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

Reply via email to