Announcing the Lifetime Safety Breakout Group

Following up on the recent LLVM Memory Safety WG meeting, we’re setting up a new breakout group focused on Lifetime Safety in Clang.

There’s growing interest in this area, and we think a dedicated forum will help coordinate ongoing work, discuss the roadmap, and involve more contributors.

Lifetime Analysis: Current Status

For those not already familiar, we’re working on a new lifetime analysis in Clang to catch issues like use-after-scope or returning pointers to stack memory. The analysis is alias-based and draws inspiration from Rust’s borrow checker (specifically, Polonius). More details in the RFC.

The initial implementation targets intra-procedural analysis for C++ raw pointers. This keeps the surface area small while we iterate. Over time, we aim to enable this analysis by default in Clang, with both “permissive” and “strict” modes to balance noise and coverage.

Goals of the Breakout Group

This breakout group will be a space to:

  • Coordinate between current contributors (from Google and Apple) and others interested in getting involved.
  • Discuss design, milestones, and direction for the analysis.
  • Invite contributions, including implementation help, code reviews, and early feedback from users who are willing to try the analysis and report issues.
  • Explore related efforts, such as lifetime annotations in CSA.

Who’s Involved

The following folks have expressed interest in the initial meetings:

We welcome anyone from the LLVM community who’s interested in joining.
Meetings will be announced here and also added to the LLVM public calendar.

If you’d like to be involved, feel free to comment here or reach out directly.

6 Likes