[PATCH] D124128: Thread safety analysis: Store CapabilityExprs in ScopedLockableFactEntry (NFC)

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 07:26:36 PDT 2022


aaronpuchert added inline comments.


================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:911-919
+    UnderlyingMutexes.push_back(UnderlyingCapability{M, UCK_Acquired});
   }
 
   void addExclusiveUnlock(const CapabilityExpr &M) {
-    UnderlyingMutexes.emplace_back(M.sexpr(), UCK_ReleasedExclusive);
+    UnderlyingMutexes.push_back(UnderlyingCapability{M, UCK_ReleasedExclusive});
   }
 
----------------
aaron.ballman wrote:
> I think we can continue to use `emplace_back()` here, can't we?
For `emplace_back` we need a constructor and can't just do aggregate initialization. But I could omit the explicit type, like `UnderlyingMutexes.push_back({M, UCK_*})`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124128/new/

https://reviews.llvm.org/D124128



More information about the cfe-commits mailing list