[clang] [Lifetime Safety] Highlight lifetimebound calls in alias chain diagnostics (PR #206337)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 18 01:06:52 PDT 2026
iitianpushkar wrote:
Hey @Xazax-hun @NeKon69, I have updated the patch with the suggested changes. Please review it once.
Note : 1 check is failing but unrelated to this pr. Maybe some infra side issue.
Summary of the current design:
- `getFunctionCallInfo(Call)` centralizes callee + argument extraction for calls, constructors, member calls, and operator calls. For instance member calls, the implicit object argument is represented as argument 0.
- `getTrackedArgInfo(FD, Args, I)` is the single shared place that decides whether an argument is tracked for Lifetime Safety.
- `getTrackingInfoForCallArg(Call, Source)` is diagnostic-side glue: reporting has alias-chain expressions rather than the original argument index, so this helper finds the matching argument and then calls `getTrackedArgInfo`.
`getTrackedArgInfo` now distinguishes:
- explicit `lifetimebound`
- inferred/heuristic lifetimebound-style tracking
- not tracked
For explicit cases, the note says:
- `because parameter 'x' is marked 'lifetimebound'`
- `because the implicit object parameter is marked 'lifetimebound'`
For inferred cases, the note says:
- `because parameter 'x' is inferred as lifetimebound`
- `because the implicit object parameter is inferred as lifetimebound`
https://github.com/llvm/llvm-project/pull/206337
More information about the cfe-commits
mailing list