Skip to content

Latest commit

 

History

History

rush-compiler-llvm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

LLVM Compiler Backend

A multiple-target rush compiler backend using the LLVM framework and the Inkwell crate.

Prerequisites

In order to compile the LLVM backend, please ensure that you have a valid LLVM installation on your machine. For further information and troubleshooting, please consult the llvm-sys crate's documentation as it is used by Inkwell.

Compiling and Running rush Code

Compilation

  • Prerequisite: A file ending in .rush which contains the program.
  • Execute following command as it will generate the output.o file from the source program.
cargo run your-file.rush

Linking

  • Since rush programs depend on some sort of standard library, linking the .o file using gcc will likely result in a valid program.
  • In order to link the output.o alongside your system's C library, issue following command.
gcc output.o -o output

Running the Program

  • Since the output of the previous command is a binary, it can be executed using the following command.
  • The suffix containing echo ... is optional and merely prints out the program's exit-code.
./output ; echo $?