|
CppInterOp
C++ Language Interoperability Layer
|
Classes | |
| struct | is_handle_vector |
| Detect vector-of-handle types. More... | |
| struct | is_handle_vector< std::vector< Cpp::DeclRef > > |
| struct | is_handle_vector< std::vector< Cpp::FuncRef > > |
| struct | is_pointer_vector |
| Matches std::vector<T*> for any pointer element type. More... | |
| struct | is_pointer_vector< std::vector< T * > > |
| struct | OutParam |
| Marks a function parameter as an output container (e.g. More... | |
| struct | ReproBuffer |
| Internal helper to stringify arguments into a C++ call format. More... | |
| struct | TraceData |
| Holds all the data that is only needed when tracing is active. More... | |
| class | TraceInfo |
| class | TraceRegion |
Functions | |
| void | InitTracing () |
| Activate tracing. | |
| static void | WriteVersionComment (llvm::raw_ostream &OS, const std::string &Version) |
| Helper: emit version info as comment lines. | |
| static std::string | GetCppInterOpLibPath () |
| dladdr-based path to libclangCppInterOp, used as the dispatch-mode fallback. | |
| static void | WriteBuildContext (llvm::raw_ostream &OS) |
Stream Cpp::GetBuildInfo() into the prologue as // comments. | |
| static void | WriteReproducerPrologue (llvm::raw_ostream &OS, llvm::StringRef Title, const std::string &Version, llvm::StringRef Footnote) |
| Emit a prologue compilable in two modes selected by -D: default <CppInterOp/CppInterOp.h>, static-link -DCPPINTEROP_USE_DISPATCH <CppInterOp/Dispatch.h>, dlopen-based The dispatch path reads CPPINTEROP_LIBRARY_PATH and falls back to the dladdr-captured libclangCppInterOp path (when available). | |
| std::string | StartTracing (bool WriteOnStdErr=true) |
| Begin recording a traced region. | |
| void | StopTracing (const std::string &Version="") |
| End the traced region and write the reproducer file containing only the calls made between StartTracing() and this call. | |
| template<typename Container > | |
| OutParam | MakeOutParam (const Container &C) |
| Create an OutParam for any container. | |
| template<typename T > | |
| OutParam | MakeOutParam (T *) |
| Scalar pointer overload (e.g. | |
Variables | |
| TraceInfo * | TheTraceInfo = nullptr |
| Process-global tracer pointer. | |
| template<typename T > | |
| constexpr bool | is_pointer_vector_v = is_pointer_vector<T>::value |
| template<typename T > | |
| constexpr bool | is_handle_v |
| Detect opaque handle structs (Cpp::DeclRef, Cpp::TypeRef, etc.) | |
| template<typename T > | |
| constexpr bool | is_handle_vector_v = is_handle_vector<T>::value |
|
static |
dladdr-based path to libclangCppInterOp, used as the dispatch-mode fallback.
Empty for statically-linked images (where dladdr returns the executable, not a real shared object) so the reproducer falls through to CPPINTEROP_LIBRARY_PATH.
Definition at line 103 of file Tracing.cpp.
References Cpp::GetVersion().
Referenced by WriteReproducerPrologue().
| void CppInterOp::Tracing::InitTracing | ( | ) |
Activate tracing.
Called once during process initialization. After this, TheTraceInfo is non-null and all INTEROP_TRACE calls record.
Definition at line 48 of file Tracing.cpp.
References Cpp::CppInterOpTraceJitCallInvokeDestructorImpl(), CppInternal::DispatchRaw::CppInterOpTraceJitCallInvokeDestructorImpl, Cpp::CppInterOpTraceJitCallInvokeImpl(), CppInternal::DispatchRaw::CppInterOpTraceJitCallInvokeImpl, Cpp::CppInterOpTraceJitCallInvokeReturnImpl(), CppInternal::DispatchRaw::CppInterOpTraceJitCallInvokeReturnImpl, and TheTraceInfo.
Referenced by Cpp::GetInterpreters(), and StartTracing().
| OutParam CppInterOp::Tracing::MakeOutParam | ( | const Container & | C | ) |
Create an OutParam for any container.
Only sets up handle registration when the container's value_type is a pointer.
Definition at line 272 of file Tracing.h.
References CppInterOp::Tracing::TraceInfo::appendToLog(), CppInterOp::Tracing::TraceInfo::getOrRegisterHandle(), CppInterOp::Tracing::OutParam::IsPointerContainer, CppInterOp::Tracing::TraceInfo::lookupHandle(), CppInterOp::Tracing::OutParam::RegisterHandles, and CppInterOp::Tracing::OutParam::SourceAddr.
| OutParam CppInterOp::Tracing::MakeOutParam | ( | T * | ) |
Scalar pointer overload (e.g.
bool* HadError). Rendered as nullptr at the call site – replay only needs the call sequence.
Definition at line 300 of file Tracing.h.
References CppInterOp::Tracing::OutParam::IsScalarPointer.
|
inline |
Begin recording a traced region.
If tracing is not yet active, activates it. Returns the path where StopTracing() will write the reproducer.
| WriteOnStdErr | if true, also emit the reproducer to stderr on stop. |
Definition at line 226 of file Tracing.h.
References InitTracing(), CppInterOp::Tracing::TraceInfo::StartRegion(), and TheTraceInfo.
|
inline |
End the traced region and write the reproducer file containing only the calls made between StartTracing() and this call.
Definition at line 234 of file Tracing.h.
References CppInterOp::Tracing::TraceInfo::StopRegion(), and TheTraceInfo.
|
static |
Stream Cpp::GetBuildInfo() into the prologue as // comments.
Definition at line 118 of file Tracing.cpp.
References Cpp::GetBuildInfo().
Referenced by WriteReproducerPrologue().
|
static |
Emit a prologue compilable in two modes selected by -D: default <CppInterOp/CppInterOp.h>, static-link -DCPPINTEROP_USE_DISPATCH <CppInterOp/Dispatch.h>, dlopen-based The dispatch path reads CPPINTEROP_LIBRARY_PATH and falls back to the dladdr-captured libclangCppInterOp path (when available).
Definition at line 137 of file Tracing.cpp.
References GetCppInterOpLibPath(), WriteBuildContext(), and WriteVersionComment().
Referenced by CppInterOp::Tracing::TraceInfo::StopRegion(), and CppInterOp::Tracing::TraceInfo::writeToFile().
|
static |
Helper: emit version info as comment lines.
Definition at line 88 of file Tracing.cpp.
Referenced by WriteReproducerPrologue().
|
inlineconstexpr |
Detect opaque handle structs (Cpp::DeclRef, Cpp::TypeRef, etc.)
|
inlineconstexpr |
|
inlineconstexpr |
| TraceInfo * CppInterOp::Tracing::TheTraceInfo = nullptr |
Process-global tracer pointer.
Exported because TracingTests and the crash handler (linked-mode consumers) read it directly; cppyy and Dispatch.h consumers go through the DispatchRaw trace slots declared in CppInterOpTypes.h instead.
Definition at line 46 of file Tracing.cpp.
Referenced by CppInterOp::Tracing::ReproBuffer::append(), Cpp::CppInterOpTraceJitCallInvokeDestructorImpl(), Cpp::CppInterOpTraceJitCallInvokeImpl(), Cpp::CppInterOpTraceJitCallInvokeReturnImpl(), Cpp::DefaultProcessCrashHandler(), InitTracing(), CppInterOp::Tracing::TraceInfo::isEnabled(), CppInterOp::Tracing::TraceRegion::Proxy::operator()(), StartTracing(), StopTracing(), CppInterOp::Tracing::TraceRegion::TraceRegion(), CppInterOp::Tracing::TraceInfo::~TraceInfo(), and CppInterOp::Tracing::TraceRegion::~TraceRegion().