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

Zhijie Wang via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 29 09:19:47 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)) {
----------------
aeft wrote:

Thanks for the suggestion! Used lookup instead of find + iterator since we only need the value here.

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


More information about the cfe-commits mailing list