Clang Frontend

Translates code that Clang understands into Infer's intermediate representation language IR.Sil.

All modules: ClangFrontend

Capturing source files

Start at ClangFrontend.Capture for how Infer uses Clang to parse source files, using our Clang plugin. For more information on our clang plugin itself, refer to the relevant documentation in facebook-clang-plugins:

Quick guide to changing the AST format

  1. Create a simple example (example.cpp) source file with construct that needs to be exported. The smaller the better.
  2. Export the extra information by changing the code in libtooling/ASTExporter.h. For more information, refer to the ATD_GUIDELINES.
  3. Compile Infer with the new version of facebook-clang-plugins. Running make from top level of Infer repository will do that. Sometimes there may be compilation errors due to .atd file changes --they need to be fixed.
  4. Use newly-exported information in the frontend as you please.

Tips & Tricks