Giter Club home page Giter Club logo

ctollvmcompiler's Introduction

C2LLVM Compiler

环境

  • 系统:Ubuntu16.04
  • 语言:Python3.6

安装

安装antlr4

安装antlr4-python3-runtime

pip install antlr4-python3-runtime

安装llvmlite

pip install llvmlite

使用

注意以下命令运行路径为/src目录下,即与main.py同级

生成某个源代码的LLVM IR代码

python main.py test/xxx.c   #该命令会在源代码同级目录下生成xxx.ll文件

快速编译test文件夹下所有源代码

python compile_all.py       #该命令会编译test文件夹下所有源代码

运行LLVM IR代码

lli xxx.ll

测试用例

1、src/test/palindrome.c回文检测

2、src/test/kmp.c字符串搜索

3、src/test/cal.c四则运算计算器

4、src/test/biTree.c二叉树

5、src/test/quickSort.c快排

ctollvmcompiler's People

Contributors

sercharles avatar arthurcchen 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.