This [repository](https://github.com/facebook/facebook-clang-plugins) aims to share some useful clang plugins developed at Facebook. They are mostly used by [infer](https://github.com/facebook/infer).
This folder contains the Infer frontend plugin to the [clang compiler](http://clang.llvm.org/) used to process the syntax of source files and export AST information to the Infer frontend.
It contains frontend plugins to the [clang compiler](http://clang.llvm.org/) 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
Structure of the repository
---------------------------
---------------------------
- [`libtooling`](https://github.com/facebook/facebook-clang-plugins/tree/master/libtooling) : frontend plugins (currently a clang-to-json AST exporter),
- libtooling : frontend plugins (currently a clang-to-json AST exporter),
- [`clang-ocaml`](https://github.com/facebook/facebook-clang-plugins/tree/master/clang-ocaml) : OCaml libraries to process the JSON output of frontend plugins,
- clang-ocaml : OCaml libraries to process the JSON output of frontend plugins,
Quick start
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 `clang/src/`
The plugin requires recent version of the clang compiler, re-compiled from source.
General instructions to compile clang can be found here: http://clang.llvm.org/get_started.html
To compile and use the required version of clang, please run ./clang/setup.sh.
To compile and use the required version of clang, please run ./clang/setup.sh.
Using this script should make the variable CLANG_PREFIX unnecessary to compile the plugin.
Caveat:
Caveat:
- Because of the nature of C++, clang and the plugins need to be compiled with the exact same C++ libraries.
- Because of the nature of C++, clang and the plugins need to be compiled with the exact same C++ libraries.
@ -39,4 +34,4 @@ Additional configuration options are available in `Makefile.config`.