Skip to content

Conversation

usx95
Copy link
Contributor

@usx95 usx95 commented Jul 15, 2025

Add a live origins analysis to the lifetime safety checker.

This PR introduces a new backward dataflow analysis called LiveOriginAnalysis that tracks which origins are live at each program point. The analysis:

  • Uses a LivenessLattice structure to represent the set of live origins
  • Implements transfer functions for assignment, loan issuance, and return statements
  • Joins lattices by taking the union of live origin sets

Copy link
Contributor Author

usx95 commented Jul 15, 2025

@usx95 usx95 changed the title add-liveness-finally [LifetimeSafety] Implement Lianalysis Jul 15, 2025
@usx95 usx95 changed the title [LifetimeSafety] Implement Lianalysis [LifetimeSafety] Implement LiveOrigins analysis Jul 15, 2025
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from 8bbae58 to 037a7ec Compare July 16, 2025 10:45
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from 6d91a96 to 76e0954 Compare July 16, 2025 10:45
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from 76e0954 to b51604d Compare July 16, 2025 14:08
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch 2 times, most recently from a4cba20 to 7365fc4 Compare July 16, 2025 14:27
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from b51604d to 9834dbd Compare July 16, 2025 14:28
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from 7365fc4 to a7d03b1 Compare July 16, 2025 22:10
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch 2 times, most recently from a3e57e4 to ba980c0 Compare July 17, 2025 17:48
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from a7d03b1 to d5b093e Compare July 17, 2025 17:48
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from d5b093e to 70b63ed Compare July 17, 2025 18:54
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch 2 times, most recently from 7f47b11 to 91d2800 Compare July 17, 2025 20:07
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from 9a3a69a to 8c5c8f1 Compare July 18, 2025 11:57
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch 2 times, most recently from b591be3 to e940cf0 Compare July 18, 2025 14:27
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from 8c5c8f1 to c29040a Compare July 18, 2025 14:27
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from e940cf0 to 5eadf7b Compare July 19, 2025 10:01
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch 2 times, most recently from 01b019d to e132740 Compare July 19, 2025 12:28
@usx95 usx95 self-assigned this Jul 19, 2025
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from e132740 to 8aa7431 Compare July 21, 2025 14:48
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch 2 times, most recently from 6ad27da to 7ec322f Compare July 21, 2025 22:04
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from 8aa7431 to 4443dff Compare July 21, 2025 22:05
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from 7ec322f to 65f5402 Compare July 22, 2025 10:33
@usx95 usx95 force-pushed the users/usx95/07-15-add-liveness-finally branch from 4443dff to 22e01ed Compare July 22, 2025 10:34
@usx95 usx95 force-pushed the users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry branch from 65f5402 to 7a78e40 Compare July 23, 2025 09:53
Base automatically changed from users/usx95/07-14-users_usx95_lifetime-safety-add-loan-expiry to main July 23, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:temporal-safety Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant