Code Monkey home page Code Monkey logo

facebook-clang-plugins's Introduction

Deprecation Warning

This repo is deprecated. Development has moved to the Infer repo.

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 clang/src/

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. 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 Makefile.config.

Licence

The plugins are MIT-licensed.

facebook-clang-plugins's People

Contributors

ma2bd avatar jvillard avatar dulmarod avatar martinoluca avatar da319 avatar martintrojer avatar ddino avatar mbouaziz avatar skcho avatar artempyanykh avatar hansonw avatar geoffviola avatar vsilyaev avatar tarikozket avatar milend avatar katiejots avatar flarnie avatar xvilka avatar amar1729 avatar aytey avatar ezgicicek avatar jeremydubreil avatar jberdine avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.