[Lldb-commits] [PATCH] D35083: [TypeSystem] Guard the global `ASTSourceMap` with a mutex

Lang Hames via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 6 18:33:16 PDT 2017


lhames added inline comments.


================
Comment at: source/Symbol/ClangExternalASTSourceCommon.cpp:24
+template <typename FnType>
+static decltype(std::declval<FnType>()(std::declval<ASTSourceMap&>()))
+WithExclusiveSourceMap(FnType fn) {
----------------
Does std::result_of<FnType>::type work as the return type?

http://en.cppreference.com/w/cpp/types/result_of


================
Comment at: source/Symbol/ClangExternalASTSourceCommon.cpp:28
   static ASTSourceMap *s_source_map = new ASTSourceMap;
-  return *s_source_map;
+  static std::mutex s_source_map_mutex;
+  
----------------
Should this be on a context object of some kind (ASTContext?).


Repository:
  rL LLVM

https://reviews.llvm.org/D35083





More information about the lldb-commits mailing list