clang-tools 8.0.0

Public Member Functions | Public Attributes | List of all members
clang::clangd::trace::Span Class Reference

Records an event whose duration is the lifetime of the Span object. More...

`#include <Trace.h>`

Collaboration diagram for clang::clangd::trace::Span:
[legend]

## Public Member Functions
| Span (llvm::Twine Name)
| ~Span ()

## Public Attributes
llvm::json::Object *const | Args
| Mutable metadata, if this span is interested. More...

## Detailed Description

Records an event whose duration is the lifetime of the Span object.

This lifetime is extended when the span's context is reused.

This is the main public interface for producing tracing events.

Arbitrary JSON metadata can be attached while this span is active: SPAN_ATTACH(MySpan, "Payload", SomeJSONExpr);

SomeJSONExpr is evaluated and copied only if actually needed.

Definition at line 83 of file Trace.h.

## Constructor & Destructor Documentation

## ◆ Span()

clang::clangd::trace::Span::Span | ( | llvm::Twine | Name | ) |

Definition at line 224 of file Trace.cpp.

## ◆ ~Span()

clang::clangd::trace::Span::~Span | ( |  | ) |

Definition at line 228 of file Trace.cpp.

## Member Data Documentation

## ◆ Args

llvm::json::Object* const clang::clangd::trace::Span::Args

Mutable metadata, if this span is interested.

Prefer to use SPAN_ATTACH rather than accessing this directly. The lifetime of Args is the whole event, even if the Span dies.

Definition at line 91 of file Trace.h.

The documentation for this class was generated from the following files:

- Trace.h
- Trace.cpp