diff options
author | Dean Michael Berris <dberris@google.com> | 2018-09-18 23:59:32 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-09-18 23:59:32 +0000 |
commit | b64f71b0296f45bd2a527a5da37b2692f665fcb3 (patch) | |
tree | 1f4949ae4dfbf1adce2a4499e36c62623f21ee10 /clang/lib/Analysis/ThreadSafetyCommon.cpp | |
parent | a4c53284c131bdd1ba2d330d918f42159af4eee2 (diff) | |
download | llvm-b64f71b0296f45bd2a527a5da37b2692f665fcb3.zip llvm-b64f71b0296f45bd2a527a5da37b2692f665fcb3.tar.gz llvm-b64f71b0296f45bd2a527a5da37b2692f665fcb3.tar.bz2 |
[XRay][compiler-rt] FDRLogWriter Abstraction
Summary:
This change introduces an `FDRLogWriter` type which is responsible for
serialising metadata and function records to character buffers. This is
the first step in a refactoring of the implementation of the FDR runtime
to allow for more granular testing of the individual components of the
implementation.
The main contribution of this change is a means of hiding the details of
how specific records are written to a buffer, and for managing the
extents of these buffers. We make use of C++ features (templates and
some metaprogramming) to reduce repetition in the act of writing out
specific kinds of records to the buffer.
In this process, we make a number of changes across both LLVM and
compiler-rt to allow us to use the `Trace` abstraction defined in the
LLVM project in the testing of the runtime implementation. This gives us
a closer end-to-end test which version-locks the runtime implementation
with the loading implementation in LLVM.
We also allow using gmock in compiler-rt unit tests, by adding the
requisite definitions in the `AddCompilerRT.cmake` module.
Finally, we've gone ahead and updated the FDR logging implementation to
use the FDRLogWriter for the lowest-level record-writing details.
Following patches will isolate the state machine transitions which
manage the set-up and tear-down of the buffers we're using in multiple
threads.
Reviewers: mboerger, eizan
Subscribers: mgorny, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D52220
llvm-svn: 342518
Diffstat (limited to 'clang/lib/Analysis/ThreadSafetyCommon.cpp')
0 files changed, 0 insertions, 0 deletions