compiler-research / CppInterOp

A Clang-based C++ Interoperability Library
Other
38 stars 20 forks source link

Add a libclang-style C API and improve type safety #304

Open Gnimuc opened 4 weeks ago

Gnimuc commented 4 weeks ago

TODO:

Update:

Keeping the C++ API untouched is impossible if we want libclang-styled types. As a result, I reimplemented most of the C++ APIs on the C API side.

Gnimuc commented 4 weeks ago

How to tell clang-tidy to ignore the CXCppInterOp.h? It's a C header and should not use any C++ stuff.

vgvassilev commented 4 weeks ago

I feel like this PR is also addressing https://github.com/compiler-research/CPyCppyy/issues/8 to some extent. Maybe we can use the momentum gained here..

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 49.47245% with 431 lines in your changes missing coverage. Please review.

Project coverage is 66.79%. Comparing base (e0fa91e) to head (4d0eaab).

:exclamation: There is a different number of reports uploaded between BASE (e0fa91e) and HEAD (4d0eaab). Click for more details.

HEAD has 21 uploads less than BASE | Flag | BASE (e0fa91e) | HEAD (4d0eaab) | |------|------|------| ||22|1|
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304/graphs/tree.svg?width=650&height=150&src=pr&token=7UWTYSVVT5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research)](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) ```diff @@ Coverage Diff @@ ## main #304 +/- ## ========================================== - Coverage 72.22% 66.79% -5.43% ========================================== Files 8 9 +1 Lines 2963 3783 +820 ========================================== + Hits 2140 2527 +387 - Misses 823 1256 +433 ``` | [Files](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) | Coverage Δ | | |---|---|---| | [include/clang/Interpreter/CppInterOp.h](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&filepath=include%2Fclang%2FInterpreter%2FCppInterOp.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-aW5jbHVkZS9jbGFuZy9JbnRlcnByZXRlci9DcHBJbnRlck9wLmg=) | `96.00% <ø> (ø)` | | | [lib/Interpreter/CppInterOp.cpp](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&filepath=lib%2FInterpreter%2FCppInterOp.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-bGliL0ludGVycHJldGVyL0NwcEludGVyT3AuY3Bw) | `78.66% <95.91%> (+0.14%)` | :arrow_up: | | [lib/Interpreter/CXCppInterOp.cpp](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&filepath=lib%2FInterpreter%2FCXCppInterOp.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-bGliL0ludGVycHJldGVyL0NYQ3BwSW50ZXJPcC5jcHA=) | `46.64% <46.64%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) | [Files](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) | Coverage Δ | | |---|---|---| | [include/clang/Interpreter/CppInterOp.h](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&filepath=include%2Fclang%2FInterpreter%2FCppInterOp.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-aW5jbHVkZS9jbGFuZy9JbnRlcnByZXRlci9DcHBJbnRlck9wLmg=) | `96.00% <ø> (ø)` | | | [lib/Interpreter/CppInterOp.cpp](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&filepath=lib%2FInterpreter%2FCppInterOp.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-bGliL0ludGVycHJldGVyL0NwcEludGVyT3AuY3Bw) | `78.66% <95.91%> (+0.14%)` | :arrow_up: | | [lib/Interpreter/CXCppInterOp.cpp](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304?src=pr&el=tree&filepath=lib%2FInterpreter%2FCXCppInterOp.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-bGliL0ludGVycHJldGVyL0NYQ3BwSW50ZXJPcC5jcHA=) | `46.64% <46.64%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/304/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research)