Skip to content
Clang bindings for .NET and Mono written in C#
Branch: master
Clone or download
tannergooding Minor fixups to provide better diagnostics and notes on what should b…
…e done. (#47)

* Some minor fixups to try and ensure we handle things appropriately

* Print diagnostics so users know when there are potential parsing issues.
Latest commit 7c45035 May 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ClangSharp.Test
ClangSharp Adding support for parsing expressions attached to EnumConstantDecl (#45 May 11, 2019
ClangSharpPInvokeGenerator Minor fixups to provide better diagnostics and notes on what should b… May 12, 2019
.editorconfig Fixes for clang6 on Windows Jul 4, 2018
.gitignore Fixes for clang6 on Windows Jul 4, 2018
ClangSharp.sln Fixing the ClangSharp solution to use SDK style projects and AnyCPU c… Apr 23, 2019
LICENSE.txt License.txt Feb 13, 2015
README.md Fixes for clang6 on Windows Jul 4, 2018

README.md

ClangSharp

ClangSharp are strongly-typed safe Clang bindings written in C# for .NET and Mono, tested on Linux and Windows. ClangSharp is self-hosted and ClangSharp auto-generates itself parsing LLVM-C header files.

If you're on Windows, consider using the ClangSharp 3.6 NuGet Package - built from Clang 3.6 Release.

Building ClangSharp

dotnet msbuild /t:GenerateClangSharp ClangSharpPInvokeGenerator

Features

  • Auto-generated using Clang C headers files, and supports all functionality exposed by them ~ which means you can build tooling around C/C++
  • Type safe (CXIndex and CXTranslationUnit are different types, despite being pointers internally)
  • Nearly identical to Clang C APIs, e.g. clang_getDiagnosticSpelling in C, vs. clang.getDiagnosticSpelling (notice the . in the C# API)

ClangSharp PInvoke Generator

A great example of ClangSharp's use case is its self-hosting mechanism Clang Sharp PInvoke Generator

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

You can’t perform that action at this time.