vsk added inline comments.

================
Comment at: lldb/include/lldb/Symbol/Function.h:661
+  std::mutex
+      m_call_edges_lock; ///< Exclusive lock that controls read/write
+                         ///  access to m_call_edges and m_call_edges_resolved.
----------------
aprantl wrote:
> nit: When inline comments span multiple lines it's IMO less confusing to 
> convert them to up-front comments.
> ```
>   /// Exclusive lock that controls read/write
>   /// access to m_call_edges and m_call_edges_resolved.
>   std::mutex m_call_edges_lock;
> ```
> 
> I also doubt that the ones in this file are formatted correctly, I think the 
> continuation needs to also use `///<`.
Sounds good. I'll reformat all of the data member doxygen comments in this file 
in a follow up.


================
Comment at: lldb/source/Symbol/Function.cpp:293
 llvm::ArrayRef<std::unique_ptr<CallEdge>> Function::GetCallEdges() {
+  std::lock_guard<std::mutex> guard(m_call_edges_lock);
+
----------------
aprantl wrote:
> Can this be called on the same thread and would we benefit from a 
> recursive_mutex?
Function::GetCallEdges() cannot recursively call itself, so a recursive_mutex 
isn't necessary. Actually if the mutex were taken recursively, that would allow 
the m_call_edges vector to be clobbered by the n-1 GetCallEdges callers who 
took the lock before the n-th caller.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83359



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D8335... Vedant Kumar via Phabricator via lldb-commits

Reply via email to