|
CppInterOp
C++ Language Interoperability Layer
|
Opaque handle types for the CppInterOp C and C++ API. More...
#include "include/CppInterOp/CppInterOpTypes.h"

Public Attributes | |
| void * | data |
Opaque handle types for the CppInterOp C and C++ API.
Each handle wraps a single void* and is a distinct type so the compiler rejects cross-kind misuse (e.g. passing a TypeRef where a DeclRef is expected). Layout is identical across all handles — a single pointer — so they are trivially copyable and ABI-stable.
The C and C++ views are declared independently:
struct CppDeclRef { void* data; } etc. at global scope, prefixed so they don't collide with generic names from other C libraries.Cpp::DeclRef etc. in namespace Cpp, no prefix — the namespace already disambiguates. Both have identical layout, so a C-linkage function exchanging these structs across the boundary is byte-identical regardless of which view names it. The TableGen-emitted C-API .inc adds C++ typedef aliases (using CppDeclRef = Cpp::DeclRef;) so the generated C wrappers compile under C++ using the prefixed C-side names. Definition at line 66 of file CppInterOpTypes.h.
| void* CppDeclRef::data |
Definition at line 67 of file CppInterOpTypes.h.