[XRay][compiler-rt] Remove use of std::mutex and std::shared_ptr from global scope.
authorDean Michael Berris <dberris@google.com>
Wed, 2 Aug 2017 04:51:40 +0000 (04:51 +0000)
committerDean Michael Berris <dberris@google.com>
Wed, 2 Aug 2017 04:51:40 +0000 (04:51 +0000)
commit9952d95921f0d609e81aed7e5c7ddbb80a4bc132
tree3822df2063be9e865c8ff3eb41af6760d89f3ea2
parentc2f73b7fae270fab9e13edf8e24c82ada272558a
[XRay][compiler-rt] Remove use of std::mutex and std::shared_ptr from global scope.

Summary:
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).

Reviewers: dblaikie, kpw, pelikan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36078

llvm-svn: 309792
compiler-rt/include/xray/xray_records.h
compiler-rt/lib/xray/xray_fdr_logging.cc
compiler-rt/lib/xray/xray_fdr_logging_impl.h
compiler-rt/lib/xray/xray_inmemory_log.cc