[clang] [analyzer] Implement LifetimeModeling checker and refactor UseAfterLifetimeEnd (PR #205951)
Benedek Kaibas via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 7 04:28:29 PDT 2026
================
@@ -0,0 +1,20 @@
+#ifndef LLVM_CLANG_INCLUDE_STATICANALYZER_CHECKERS_LIFETIMEMODELING_H
+#define LLVM_CLANG_INCLUDE_STATICANALYZER_CHECKERS_LIFETIMEMODELING_H
+
+#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
+#include <vector>
+
+namespace clang::ento::lifetime_modeling {
+/// Returns true if the lifetime of a region has ended.
+bool isDeallocated(ProgramStateRef State, const MemRegion *Region);
----------------
benedekaibas wrote:
The `isDeallocated` function should be removed since it is not used in neither of the modeling nor the `UseAfterLifetimeEnd` checkers. I will remove this from this PR since it is dead code currently and only will be relevant in #206460. But currently it should not be in the content of this PR.
https://github.com/llvm/llvm-project/pull/205951
More information about the cfe-commits
mailing list