CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Public Attributes | List of all members
CppInterOp::Tracing::TraceData Struct Reference

Holds all the data that is only needed when tracing is active. More...

#include "lib/CppInterOp/Tracing.h"

Collaboration diagram for CppInterOp::Tracing::TraceData:
Collaboration graph
[legend]

Public Attributes

const char * Name
 
llvm::SmallString< 128 > ArgStr
 
void * Result = nullptr
 
bool HasPtrResult = false
 
bool HasRetVec = false
 Set when the call returned std::vector<P*>; ~TraceRegion uses this to spell auto _retN = Cpp::Foo(...) so element decls can read _retN[i] and the replay sees the original pointers.
 
llvm::SmallVector< const void *, 8 > RetVecPtrs
 Snapshot of the returned vector's pointer elements, taken at record() time – the source vector goes out of scope before ~TraceRegion runs.
 
double StartTime = 0
 
bool Returned = false
 
llvm::SmallVector< std::function< void(TraceInfo &, unsigned)>, 2 > OutCallbacks
 
llvm::SmallVector< unsigned, 2 > OutIndices
 _outN indices for this call's OUT pointer-containers, in left-to-right order.
 
llvm::SmallVector< bool, 2 > OutFirstUse
 Per-OUT argument flag: true on the first call with this source container (preamble decl needed), false on later calls reusing the same slot.
 
bool Nested = false
 Set when another TraceRegion was already active at construction.
 
size_t LogIndex = 0
 Slot for the ctor-emitted placeholder; the dtor rewrites it.
 

Detailed Description

Holds all the data that is only needed when tracing is active.

Heap-allocated only when TheTraceInfo != nullptr, so disabled tracing pays zero cost beyond a single pointer + bool on the stack.

Definition at line 515 of file Tracing.h.

Member Data Documentation

◆ ArgStr

llvm::SmallString<128> CppInterOp::Tracing::TraceData::ArgStr

Definition at line 517 of file Tracing.h.

◆ HasPtrResult

bool CppInterOp::Tracing::TraceData::HasPtrResult = false

Definition at line 519 of file Tracing.h.

◆ HasRetVec

bool CppInterOp::Tracing::TraceData::HasRetVec = false

Set when the call returned std::vector<P*>; ~TraceRegion uses this to spell auto _retN = Cpp::Foo(...) so element decls can read _retN[i] and the replay sees the original pointers.

Definition at line 523 of file Tracing.h.

◆ LogIndex

size_t CppInterOp::Tracing::TraceData::LogIndex = 0

Slot for the ctor-emitted placeholder; the dtor rewrites it.

Definition at line 543 of file Tracing.h.

◆ Name

const char* CppInterOp::Tracing::TraceData::Name

Definition at line 516 of file Tracing.h.

◆ Nested

bool CppInterOp::Tracing::TraceData::Nested = false

Set when another TraceRegion was already active at construction.

Nested calls skip log emission but still register handles.

Definition at line 541 of file Tracing.h.

◆ OutCallbacks

llvm::SmallVector<std::function<void(TraceInfo&, unsigned)>, 2> CppInterOp::Tracing::TraceData::OutCallbacks

Definition at line 530 of file Tracing.h.

◆ OutFirstUse

llvm::SmallVector<bool, 2> CppInterOp::Tracing::TraceData::OutFirstUse

Per-OUT argument flag: true on the first call with this source container (preamble decl needed), false on later calls reusing the same slot.

Definition at line 538 of file Tracing.h.

◆ OutIndices

llvm::SmallVector<unsigned, 2> CppInterOp::Tracing::TraceData::OutIndices

_outN indices for this call's OUT pointer-containers, in left-to-right order.

Consumed by format() at the call site and by ~TraceRegion to emit the preamble decls.

Definition at line 534 of file Tracing.h.

◆ Result

void* CppInterOp::Tracing::TraceData::Result = nullptr

Definition at line 518 of file Tracing.h.

◆ Returned

bool CppInterOp::Tracing::TraceData::Returned = false

Definition at line 529 of file Tracing.h.

◆ RetVecPtrs

llvm::SmallVector<const void*, 8> CppInterOp::Tracing::TraceData::RetVecPtrs

Snapshot of the returned vector's pointer elements, taken at record() time – the source vector goes out of scope before ~TraceRegion runs.

Definition at line 527 of file Tracing.h.

◆ StartTime

double CppInterOp::Tracing::TraceData::StartTime = 0

Definition at line 528 of file Tracing.h.


The documentation for this struct was generated from the following file: