Need help with facebook-clang-plugins?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

477 Stars 90 Forks Other 453 Commits 4 Opened issues


Plugins to clang-analyzer and clang-frontend

Services available


Need anything else?

Contributors list

Facebook Clang Plugins

This repository aims to share some useful clang plugins developed at Facebook. They are mostly used by infer.

It contains frontend plugins to the clang compiler to process the syntax of source files directly to accomplish more general tasks; specifically, we have developed a clang-to-ocaml bridge to make code analyses easier.

Structure of the repository

  • libtooling
    : frontend plugins (currently a clang-to-json AST exporter),

  • clang-ocaml
    : OCaml libraries to process the JSON output of frontend plugins,

Quick start

The current version of the plugins requires recent version of the clang compiler, re-compiled from source. Clang source which is used by this project can be found in


General instructions to compile clang can be found here:

To compile and use the required version of clang, please run ./clang/ Using this script should make the variable CLANG_PREFIX unnecessary to compile the plugin.

Caveat: - Because of the nature of C++, clang and the plugins need to be compiled with the exact same C++ libraries. - Also, the default stripping command of clang in release mode breaks plugins.

Once the target compiler is installed,

make test
should run the unit tests.

OCaml users may also run:

make -C clang-ocaml test  #requires proper ocaml libraries, see included clang-ocaml/README

Additional configuration options are available in



The plugins are MIT-licensed.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.