Giter Club home page Giter Club logo

llvm-ir's Introduction

llvm-ir

A Python library for parsing and analyzing existing LLVM IR.


The llvmlite project provides a lightweight LLVM API for Python, which includes a simple Python binding for writing the LLVM IR builder and JIT compiler. However, they do not provide a way to transform existing LLVM IR code to Python data structures.

Our project does not aim to provide a way to generate LLVM IR code, but to analyze existing LLVM IR code. Our project bases on the llvmlite project, mainly its binding and ffi module.

Key Benefits

  • The instruction supports match method to match the instruction with a pattern.
  • Some built-in analysis.
  • Same to llvmlite, Most of llvmlite uses the LLVM C API which is small but very stable (low maintenance when changing LLVM version).

Compatibility

llvmlite require at least Python 3.12 and is likely to work with greater versions.

Currently, we build LLVM bindings only for 14.x.x.

Development

Install

Make sure you have the LLVM development libraries installed. On MacOS, you can install them with:

$ brew install llvm

After

$ export LLVM_CONFIG=/usr/local/opt/llvm/bin/llvm-config

Then install the package in development mode:

$ make install

Test

We use unittest for testing. You can run the tests with:

$ make test

Example

llvm-ir's People

Contributors

sklam avatar pitrou avatar esc avatar stuartarchibald avatar seibert avatar apmasell avatar gmarkall avatar whitequark avatar tbennun avatar john-tornblom avatar franzhaas avatar qi-zhan avatar pearu avatar njwhite avatar trbabb avatar bslatkin avatar stephengroat avatar anton-malakhov avatar nehaljwani avatar jvesely avatar navyazaveri avatar yashssh avatar leonardt avatar dnadlinger avatar aguinetqb avatar mgorny avatar certik avatar occheung avatar eliben avatar folded 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.