项目作者: tuoxie007

项目描述 :
A demo about how to build a real compiler with LLVM libraries, write for the book https://github.com/tuoxie007/play_with_llvm
高级语言: C++
项目地址: git://github.com/tuoxie007/play_with_llvm_write_a_real_compiler.git
创建时间: 2020-03-29T14:28:45Z
项目社区:https://github.com/tuoxie007/play_with_llvm_write_a_real_compiler

开源协议:MIT License

下载


play_with_llvm_write_a_real_compiler

A demo about how to build a real compiler with LLVM libraries, write for the book https://github.com/tuoxie007/play_with_llvm .

How to build and run the compiler

  1. $ git clone https://github.com/tuoxie007/play_with_llvm_write_a_real_compiler
  2. $ cd play_with_llvm_write_a_real_compiler
  3. $ cd play
  4. $ ./build.sh
  5. $ ./play

Then a .o file will be wrote in tests/.

How to run the tests

  1. Open the startup file play/cli.cpp.
  2. Change the macro TEST.
  3. Rebuild and run.
  1. #define TEST "int_indexer"
  2. //#define TEST "int_pointer_arg"
  3. //#define TEST "delete_ptr"

How to write your test case

  1. Write a test file in directory play/tests.
  2. Save it with extension .play.
  3. Change the macro TEST in play/cli.cpp.
  4. Rebuild and run.

Have fun!