[clang] [LifetimeSafety] Detect use of a reference type as a use of underlying origin (PR #184295)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 29 03:49:20 PDT 2026


================
@@ -751,9 +757,13 @@ void FactsGenerator::handleUse(const Expr *E) {
   }
 }
 
-void FactsGenerator::markUseAsWrite(const DeclRefExpr *DRE) {
-  if (UseFacts.contains(DRE))
+void FactsGenerator::markUseAsWrite(const DeclRefExpr *DRE,
+                                    bool IsReferenceWrite) {
+  if (UseFacts.contains(DRE)) {
----------------
Xazax-hun wrote:

I know this is in existing code, but we have multiple consecutive lookups of `DRE`. I think we should use `find` and an iterator to avoid the double lookup. 

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


More information about the cfe-commits mailing list