[clang] [LifetimeSafety] Add suggestion and inference for implicit this (PR #176703)
Kashika Akhouri via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 21 23:12:12 PST 2026
================
@@ -137,6 +137,12 @@ OriginList *OriginManager::getOrCreateList(const Expr *E) {
return It->second;
QualType Type = E->getType();
+ // Special handling for 'this' expressions to share origins with the method's
+ // implicit object parameter.
+ if (isa<CXXThisExpr>(E)) {
----------------
kashika0112 wrote:
I have added this here in OriginManager to be consistent with DeclRefExpr, which already manages expression-to-declaration identity mapping and origin sharing here. I was hoping that adding this here would ensure all `this` expressions share origins transparently without requiring the FactsGenerator to emit redundant flow facts.
https://github.com/llvm/llvm-project/pull/176703
More information about the cfe-commits
mailing list