/Vrabche

Врабче is an SysY-lang (C-like) compiler, built for a competition.

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Врабче

Дължина на тялото около 16 cm, размах на крилете 25 cm, тежи около 30 г. Един от най-многочислените видове птици. Има изразен полов диморфизъм, мъжкият е по-ярко оцветен и по-едър. Женската е с монотонно кафеникаво оперение. Неполовозрелите птици и от двата пола имат оперение подобно на женските. Домашното врабче е непрелетна пойна птица, макар че певческите му заложби са относително скромни.

Brief

  • lex & parser
  • code generation
  • RISC-V (rv64gc) backend
  • ARMv7ve backend
  • optimization (IR, partial)
  • optimization (RVBE)

Usage

Clone and compile

git clone https://github.com/Gaomengkai/Vrabche.git
cd Vrabche
mkdir build&&cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8

Use the compiler

./Vrabche -S <SourceFilePath> [-O1|-O2|-O0] [-arm] [-dso] -o <OutputFilePath> [-save-llvm <OutputLLVMIRPath>]

Explanation:

  • The -Ox option is used to specify the optimization level of the compiler.
  • The -arm option is used to generate the arm_aapcs_vfpcc attribute in the Intermediate Representation (IR). The option will be ignored while generating ASM.
  • The -dso option is used to generate the dso_local attribute in the Intermediate Representation (IR). The option will be ignored while generating ASM.

⚠ Attention ⚠

This project is just one part of a competition about compilers. Maintained personally by the author. Except for the participants, the author does not provide any technical support, nor does it guarantee that the project can run on any platform.

Milestone

  • 20230718 This frontend passed all the 140 functional tests provided by educg.net.
  • 20230731 This project passed all the 140 functional tests provided by educg.net.