Writing your own tool

The Clang project provides three interfaces that a user can rely on to utilize Clang features and its parsing capabilities, including syntactic and semantic analyses. First, there is libclang, the primary way of interfacing with Clang, which provides a stable C API and allows an external project to plug it in and have a high-level access to the entire framework. This stable interface seeks to preserve backwards compatibility with older versions, avoiding breaking your software when a newer libclang is released. It is also possible to use libclang from other languages, for example, using the Clang Python Bindings. Apple Xcode, for instance, interacts with Clang via libclang.

Secondly, there are Clang Plugins that allow you ...

Get Getting Started with LLVM Core Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.