================
@@ -92,22 +93,36 @@ class LifetimeChecker {
   void checkAnnotations(const OriginEscapesFact *OEF) {
     OriginID EscapedOID = OEF->getEscapedOriginID();
     LoanSet EscapedLoans = LoanPropagation.getLoans(EscapedOID, OEF);
+    auto CheckParam = [&](const ParmVarDecl *PVD) {
+      // NoEscape param should not escape.
+      if (PVD->hasAttr<NoEscapeAttr>()) {
+        if (auto *ReturnEsc = dyn_cast<ReturnEscapeFact>(OEF))
+          NoescapeWarningsMap.try_emplace(PVD, ReturnEsc->getReturnExpr());
+        // if (auto *FieldEsc = dyn_cast<FieldEscapeFact>(OEF))
----------------
usx95 wrote:

Aah. Fixed. This actually detects noescape misuse when it escaping to a field.

https://github.com/llvm/llvm-project/pull/177363
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to