[PATCH] D36078: [XRay][compiler-rt] Remove use of std::mutex and std::shared_ptr from global scope.

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 02:13:07 PDT 2017


dberris created this revision.

This change attempts to remove all the dependencies we have on
std::mutex and any std::shared_ptr construction in global variables. We
instead use raw pointers to these objects, and construct them on the
heap. In cases where it's possible, we lazily initialize these pointers.

While we do not have a replacement for std::shared_ptr yet in
compiler-rt, we use this work-around to avoid having to statically
initialize the objects as globals. Subsequent changes should allow us to
completely remove our dependency on std::shared_ptr and instead have our
own implementation of the std::shared_ptr and std::weak_ptr semantics
(or completely rewrite the implementaton to not need these
standard-library provided abstractions).


https://reviews.llvm.org/D36078

Files:
  include/xray/xray_records.h
  lib/xray/xray_fdr_logging.cc
  lib/xray/xray_fdr_logging_impl.h
  lib/xray/xray_inmemory_log.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36078.108884.patch
Type: text/x-patch
Size: 7246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170731/f85b9411/attachment.bin>


More information about the llvm-commits mailing list