CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
CppInterOp::Tracing::TraceRegion Class Reference

#include "lib/CppInterOp/Tracing.h"

Classes

struct  Proxy
 Helper to allow INTEROP_TRACE() to work with zero or more arguments without relying on non-standard ##__VA_ARGS__ comma elision. More...
 

Public Member Functions

template<typename... Args>
 TraceRegion (const char *Name, Args &&... args)
 
 ~TraceRegion ()
 
 TraceRegion (const TraceRegion &)=delete
 
TraceRegionoperator= (const TraceRegion &)=delete
 
 TraceRegion (TraceRegion &&) noexcept=default
 
TraceRegionoperator= (TraceRegion &&)=delete
 
bool isActive () const
 
template<typename T >
record (T val)
 Record a non-void return value.
 
void recordVoid ()
 

Static Public Member Functions

static unsigned countParams (const char *sig)
 Count parameters from a PRETTY_FUNCTION / FUNCSIG string.
 
template<typename... Args>
static constexpr uint64_t computeOutMask ()
 Bit i set iff Args[i] is OutParam (i.e.
 
static std::optional< uint64_t > lookupOutMask (llvm::StringRef Name)
 .td-declared OUT-arg bitmask for Name (matches CppName / func), or std::nullopt for non-public-API tracepoints.
 
static std::string formatOutMaskMismatchMessage (llvm::StringRef Name, uint64_t expected, uint64_t actual)
 Pure-function diagnostic for the OUT-mask mismatch.
 

Detailed Description

Definition at line 546 of file Tracing.h.

Constructor & Destructor Documentation

◆ TraceRegion() [1/3]

template<typename... Args>
CppInterOp::Tracing::TraceRegion::TraceRegion ( const char *  Name,
Args &&...  args 
)
inline

◆ ~TraceRegion()

CppInterOp::Tracing::TraceRegion::~TraceRegion ( )
inline

Definition at line 601 of file Tracing.h.

References CppInterOp::Tracing::TheTraceInfo.

◆ TraceRegion() [2/3]

CppInterOp::Tracing::TraceRegion::TraceRegion ( const TraceRegion )
delete

◆ TraceRegion() [3/3]

CppInterOp::Tracing::TraceRegion::TraceRegion ( TraceRegion &&  )
defaultnoexcept

Member Function Documentation

◆ computeOutMask()

template<typename... Args>
static constexpr uint64_t CppInterOp::Tracing::TraceRegion::computeOutMask ( )
inlinestaticconstexpr

Bit i set iff Args[i] is OutParam (i.e.

wrapped in INTEROP_OUT). The trailing false keeps the array non-empty for sizeof...(Args)==0.

Definition at line 774 of file Tracing.h.

Referenced by CppInterOp::Tracing::TraceRegion::Proxy::operator()().

◆ countParams()

static unsigned CppInterOp::Tracing::TraceRegion::countParams ( const char *  sig)
inlinestatic

Count parameters from a PRETTY_FUNCTION / FUNCSIG string.

Counts top-level commas between the outermost '(' and ')' of the function signature, handling nested <>, (), and [] correctly.

Definition at line 724 of file Tracing.h.

Referenced by CppInterOp::Tracing::TraceRegion::Proxy::operator()().

◆ formatOutMaskMismatchMessage()

static std::string CppInterOp::Tracing::TraceRegion::formatOutMaskMismatchMessage ( llvm::StringRef  Name,
uint64_t  expected,
uint64_t  actual 
)
inlinestatic

Pure-function diagnostic for the OUT-mask mismatch.

Extracted so a non-death test can cover the format path – the assert path itself runs in a forked child whose coverage data is not merged back.

Definition at line 833 of file Tracing.h.

Referenced by CppInterOp::Tracing::TraceRegion::Proxy::operator()().

◆ isActive()

bool CppInterOp::Tracing::TraceRegion::isActive ( ) const
inline

Definition at line 685 of file Tracing.h.

◆ lookupOutMask()

std::optional< uint64_t > CppInterOp::Tracing::TraceRegion::lookupOutMask ( llvm::StringRef  Name)
static

.td-declared OUT-arg bitmask for Name (matches CppName / func), or std::nullopt for non-public-API tracepoints.

Definition at line 62 of file Tracing.cpp.

Referenced by CppInterOp::Tracing::TraceRegion::Proxy::operator()().

◆ operator=() [1/2]

TraceRegion & CppInterOp::Tracing::TraceRegion::operator= ( const TraceRegion )
delete

◆ operator=() [2/2]

TraceRegion & CppInterOp::Tracing::TraceRegion::operator= ( TraceRegion &&  )
delete

◆ record()

template<typename T >
T CppInterOp::Tracing::TraceRegion::record ( val)
inline

Record a non-void return value.

Tracks pointer results for the reproducer's handle chain (e.g. auto v1 = Cpp::GetScope(...)).

Definition at line 689 of file Tracing.h.

◆ recordVoid()

void CppInterOp::Tracing::TraceRegion::recordVoid ( )
inline

Definition at line 716 of file Tracing.h.


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