[clang] [analyzer] Remove getRegionName from LifetimeModeling and its dependent checkers (PR #214245)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 08:20:09 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);
----------------
steakhal wrote:

If we hit the fallback case, wouldn't that mean that the warning message would be messed up?
This would be a regression because in the past it used to fall back on using "the region".

https://github.com/llvm/llvm-project/pull/214245


More information about the cfe-commits mailing list