Back to CERN-HSF
GSoC 2026

Implement CppInterOp API exposing memory ownership and thread safety

CppInterOp is a Clang-based library that provides an API to examine C/C++ code, enabling language bindings such as cppyy to interact with C++ code at runtime. While CppInterOp exposes function metadata, it currently lacks the ability to expose two critical properties of C/C++ code: memory ownership and thread safety characteristics of functions. Language bindings have no way to determine if the function allocates memory on the heap, whether the caller is responsible for deallocating the memory, what allocation mechanism was used, or which function should be called to free it. Similarly, there is no information about whether a function is safe to call from multiple threads. This project proposes to implement analysis using Clang’s AST and LLVM IR to extract memory ownership and thread safety information from C++ code, and expose this information for language binding tools. The analysis starts from declaration-level checks (return type, const qualifiers, attributes) and continues to function body traversal for exposing further details.

Project details

Contributor

Kerem Sahin

Mentors

Not available

Technologies

Not listed in the archive