Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
leewei05 authored and Lai-YT committed Jul 5, 2024
1 parent ebefa75 commit d787d64
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ VitaminC 🍋 is an educational C compiler frontend written in C++. As a fronten
> [!WARNING]
> This project is still under development. Many features are not yet implemented. Currently, we do not support preprocessor directives, and only the `int` type and its pointer, as well as object types, are supported.
The main goal of this project is to demonstrate how a compiler frontend works with [the LLVM compiler infrastructure](https://llvm.org/) and generates LLVM IR. However, we are not yet there. Currently, we generate [QBE](https://c9x.me/compile/) IR manually.
The main goal of this project is to demonstrate how a compiler frontend works with [the LLVM compiler infrastructure](https://llvm.org/) and generates LLVM IR. Currently, this compiler can generate [QBE](https://c9x.me/compile/) IR and [LLVM](https://llvm.org/docs/LangRef.html) IR.

We are not aiming to be a fully compliant C compiler, although we strive to be as compliant as possible with C89 and support common C99 features.

## Prerequisites

- A C++ compiler that supports C++17.
- [GNU Make](https://www.gnu.org/software/make/): for building the project.
- [QBE](https://c9x.me/compile/releases.html): for compiling the QBE IR down to assembly.
- [QBE](https://c9x.me/compile/releases.html): for compiling QBE IR to assembly.
- [LLVM-18](https://releases.llvm.org/): for generating LLVM IR and compiling it to assembly.
- [cxxopts](https://github.com/jarro2783/cxxopts): for command-line argument parsing.
- [fmt](https://fmt.dev/latest/index.html): for modern C++ formatting.
- (test-only) [turnt](https://github.com/cucapra/turnt): for snapshot testing.
Expand Down Expand Up @@ -49,10 +50,10 @@ A simple C compiler.
Usage:
./vitaminc [options] file

-o, --output <file> Write output to <file> (default: a.out)
-d, --dump Dump the abstract syntax tree
-t, --target [qbe] Specify target IR (default: qbe)
-h, --help Display available options
-o, --output <file> Write output to <file> (default: a.out)
-d, --dump Dump the abstract syntax tree
-t, --target [qbe|llvm] Specify target IR (default: qbe)
-h, --help Display available options
```

## License
Expand Down

0 comments on commit d787d64

Please sign in to comment.