[clang] [analyzer] Remove getRegionName from LifetimeModeling and its dependent checkers (PR #214245)
Benedek Kaibas via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 5 08:35:25 PDT 2026
================
@@ -71,7 +71,8 @@ void DanglingPtrDeref::reportUseAfterScope(const MemRegion *Region,
CheckerContext &C) const {
auto BR = std::make_unique<PathSensitiveBugReport>(
BugMsg,
- (llvm::Twine("Use of ") + lifetime_modeling::getRegionName(Region) +
+ (llvm::Twine("Use of ") +
+ Region->getDescriptiveName(/*UseQuotes=*/true, /*AllowFallback=*/true) +
" after its lifetime ended."),
N);
----------------
benedekaibas wrote:
It depends on which fallback case will get executed in https://github.com/llvm/llvm-project/blob/8723e3139f7bfb046124938305ef3d05c4ad726f/clang/lib/StaticAnalyzer/Core/MemRegion.cpp#L725
If that is what you mean, then yes based on which fallback path gets executed the message would not be deterministically "the region". This is how I understand it.
Based on https://github.com/llvm/llvm-project/pull/213991/changes#r3720497744 to still preserve our own fallback which would be "the region".
https://github.com/llvm/llvm-project/pull/214245
More information about the cfe-commits
mailing list