Git Product home page Git Product logo

pasta's Introduction

PASTA

PASTA is a C++ library that abstracts the Clang compiler toolchain, and provides detailed access to compilation artifacts using APIs that mirror those available in Clang. PASTA tries to achieve the following goals:

  • Provide a baseline set of APIs that is relatively stable and does not require someone to actually depend directly on Clang headers/libraries, thus enabling a substantially easier distribution model.

  • Properly manage memory for all objects provided through the API. One should not have to worry about object lifetimes when using PASTA.

  • Provide additional information/access. Native Clang APIs do not provide detailed token information of any kind. One cannot ask for the tokens associated with an AST node, for example. PASTA attempts to resolve this, among other similar issues.

Getting and Building the Code

First, update aptitude and get install the baseline dependencies such is for example git, cmake, ninja and your compiler of choice (remember it needs to support C++20). It is useful to use the same compiler at every subset to avoid some name mangling problems. If you're using macOS then we recommend installing Homebrew, and ensuring that you have Python 3.9 installed, along with an up-to-date cmake and ninja.

PASTA

And finally to build PASTA itself.

On Linux

git clone https://github.com/trailofbits/pasta.git
mkdir -p pasta-build
cd pasta-build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DPASTA_ENABLE_INSTALL=ON \
    -GNinja \
    ../pasta
ninja install

On macOS

On macOS, you may need to manually specify the Clang compiler. You can't, however, just specify clang or clang++, because then vcpkg will try to take over and produce unusual results. Therefore, you should give the absolute path to your Clang.

git clone https://github.com/trailofbits/pasta.git
mkdir -p pasta-build
cd pasta-build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_COMPILER=`which clang` \
    -DCMAKE_CXX_COMPILER=`which clang++` \
    -DPASTA_ENABLE_INSTALL=ON \
    -GNinja \
    ../pasta
ninja install

License

PASTA is licensed according to the Apache 2.0 license. Large parts of PASTA are semi-autogenerated from Clang APIs. Clang is also licensed under Apache 2.0, with LLVM exceptions.

This research was developed with funding from the Defense Advanced Research Projects Agency (DARPA). The views, opinions and/or findings expressed are those of the author and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government.

Distribution Statement A โ€“ Approved for Public Release, Distribution Unlimited

pasta's People

Contributors

pgoodman avatar pappasbrent avatar frabert avatar kumarak avatar adrianherrera avatar ninja3047 avatar ekilmer avatar alessandrogario avatar 2over12 avatar artemdinaburg avatar 2lambda123 avatar

Watchers

 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.