[clang] [Lifetime Safety] Highlight lifetimebound calls in alias chain diagnostics (PR #206337)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 14 04:25:37 PDT 2026
================
@@ -105,6 +107,92 @@ bool implicitObjectParamIsLifetimeBound(const FunctionDecl *FD) {
return isNormalAssignmentOperator(FD);
}
+std::optional<LifetimeBoundParamInfo>
+getLifetimeBoundParamInfo(const FunctionDecl *FD, unsigned I) {
----------------
Xazax-hun wrote:
Apologise, indeed I was a bit confused and not specific enough. While indeed the lifetime bound annotation processing is factored out, I think the logic in `ShouldTrackArg` overlaps very heavily with this function and it is unfortunate significant portion of this loop is implemented twice.
I wonder if we should just do all the work once, basically factoring out `ShouldTrackArg` fully, and change the diagnostic to either say something was marked lifetimebound or something was inferred as lifetimebound if we had some other heuristics in place. I want there to be a single source or truth, a single function that calculates whether we consider something lifetimebound or not, and use it everywhere.
https://github.com/llvm/llvm-project/pull/206337
More information about the cfe-commits
mailing list