xoofx / CppAst.NET

CppAst is a .NET library providing a C/C++ parser for header files powered by Clang/libclang with access to the full AST, comments and macros
BSD 2-Clause "Simplified" License
482 stars 63 forks source link

Update to clang 10? #25

Closed StephenHodgson closed 4 years ago

StephenHodgson commented 4 years ago

Any plans to update this library to use clang 10?

xoofx commented 4 years ago

What are you looking for specifically in clang 10?

StephenHodgson commented 4 years ago

See https://github.com/xoofx/CppAst.CodeGen/issues/3

xoofx commented 4 years ago

But why do you think that clang 10 is fixing this? They barely make changes to the libclang API and implementation, so usually bugs like this can stay for a while...

xoofx commented 4 years ago

the issue is usually with libclang, not with clang. Libclang makes a C wrapper of their internal C++ API, but their wrapper is incomplete, so things perfectly exposed in C++ can be wrongly exposed (or not exposed at all) through libclang, that's a known issue unfortunately (for example: https://foonathan.net/2017/04/cppast/)

StephenHodgson commented 4 years ago

Idk I thought it would help. I get correct tokens from other forms of this library

xoofx commented 4 years ago

Idk I thought it would help. I get correct tokens from other forms of this library

Which one? Do you have a small repro with these other libraries that I could check?

StephenHodgson commented 4 years ago

Not a small repo, no. I was using the main branch of https://github.com/microsoft/ClangSharp

I also tried https://github.com/mono/CppSharp

All three don't really work for me but in lots of different ways lol.

I'm beginning to think it's impossible to generate good bindings for third party libraries.

xoofx commented 4 years ago

I will probably wait that https://github.com/microsoft/ClangSharp release NuGet packages.

I had to release my own https://github.com/xoofx/libclang but I would really prefer that there is a single source to manage that.

StephenHodgson commented 4 years ago

Their beta came out recently.

I was trying to get their p/invoke gen setup but was unsuccessful. Tbh, I really like how you've setup the code gen in https://github.com/xoofx/CppAst.CodeGen better. Just makes more sense.

xoofx commented 4 years ago

So latest master is using ClangSharp 10.0 beta package, though, I'm not able to get tests running on the CI for some reasons...

xoofx commented 4 years ago

Tracking the issue with RID with ClangSharp here

xoofx commented 4 years ago

So CppAst 0.5.0-alpha-001 and CppAst.CodeGen are now both using clang 10