Milestone #3: AST to LLVM IR

Due: Friday March 3rd at 11:59pm

This milestone will require you to complete the translation from AST to LLVM IR.

Milestone Requirement: LLVM IR

For this milestone, your compiler will take the validated AST from semantic analysis translate it into LLVM IR. As stated in lecture, the output of LLVM IR is a .ll file that contains the original source code represented in its LLVM IR form.

You are only required to use a stack-based implementation.

Milestone Requirement: ARM Code Generation

After LLVM IR translation, you will then generate the equivalent ARM64 assembly code. As stated in lecture, the output of the ARM assembly code is a .s file that contains the original source code represented in its ARM assembly form.

You are only required to use a stack-based implementation.

Command-line Options Augmented

For this milestone, the must augment the compiler with the additional command line argument flags:

  • -llvm=[STRING]: Produces the LLVM IR form from the input source file. The filename must be the same as the original source filename but with the extension of .ll. The [STRING] argument is an optional argument that states the target triple string. For nowm the default target triple string must be "x86_64-linux-gnu".

  • -arm64: Produces the ARM64 form from the input source file. The filename must be the same as the original source filename but with the extension of .s.

Grading and What to Submit

You must provide the following to get full credit for this milestone:

  1. Use the benchamrks repository as a means for testing for correctness.

The milestone is 5% of your grade and the exact weights for grading are:

  • 5% credit: Generation to LLVM IR and ARM64 is fully complete with a few minor edge-cases not handled.

  • 3% credit: Generation to LLVM IR and ARM64 is partially implemented.

  • 0% credit: No solution provided or none of the above requirements have been met.

Submission

Before submitting, make sure you’ve added, committed, and pushed all your code to GitHub. You must submit your final work through Gradescope (linked from our Canvas site) in the “Milestone #3” assignment page via two ways,

  1. Uploading from Github directly (recommended way): You can link your Github account to your Gradescope account and upload the correct repository based on the homework assignment. When you submit your homework, a pop window will appear. Click on “Github” and then “Connect to Github” to connect your Github account to Gradescope. Once you connect (you will only need to do this once), then you can select the repository you wish to upload and the branch (which should always be “main” or “master”) for this course.

  2. Uploading via a Zip file: You can also upload a zip file of the assignment directory.