Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucaanza/myfirstllvm_compiler
Creating a Compiler for the Kaleidoscope Programming Language using LLVM16.
https://github.com/lucaanza/myfirstllvm_compiler
bison compiler flex kaleidoscope llvm
Last synced: 29 days ago
JSON representation
Creating a Compiler for the Kaleidoscope Programming Language using LLVM16.
- Host: GitHub
- URL: https://github.com/lucaanza/myfirstllvm_compiler
- Owner: lucaAnza
- Created: 2024-02-06T16:55:31.000Z (9 months ago)
- Default Branch: Step1
- Last Pushed: 2024-07-08T16:35:34.000Z (4 months ago)
- Last Synced: 2024-09-26T18:22:46.226Z (about 1 month ago)
- Topics: bison, compiler, flex, kaleidoscope, llvm
- Language: C++
- Homepage:
- Size: 34.7 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# My First LLVM Compiler
In this repository you can find the implementation of a compiler.
The compiler is divided into Front-End and Middle-End.
The Back-End part is not implemented đĢ## Introduction
### What is the purpose of a compiler?
A compiler translates code written in a high-level programming language into machine code that a computer can understand. In more detail, a compiler is a special type of software that serves as a translator between the programmer and the computer.
### Anatomy of a compiler
### Compiler toolchain
## Dependencies âī¸
The Front-End and Middle-End have different versions of LLVM and different dependencies.
- Each project directory contains a README.md file that specifies the requirements.
## Middle-end đ
In this directory you can find some optimizations on IR Code.
Each optimization is made modifying LLVM source code or creating a new pass.
_middle-end function:_
---
### Which optimizations or analysis?
#### Assignment1(optimization-LLVM)
- Algebric Identity.
- Strengh Reduction.
- Multi Instructions opt.#### Assignment2(analiysis)
->Data Flow Analysis on three different case:
- Constant Propagation.
- Dominator Analysis.
- Very Busy Expressions.#### Assignment3(optimization-LLVM)
- LICM (Loop Invariant Code Motion).
#### Assignment4(optimization-LLVM)
- LI (Loop Fusion).
## Front-End đ
Given the following compilation stages:
In this part of the project, we will analyze and produce a working example of the first 4 phases (Front-End).
The phases are as follows:1. Lexical analyzer.
2. Syntax analyzer.
3. Semantic analyzer.
4. Intermediate code generator.
Front-End structure
- Lexer is implemented using [Flex](https://github.com/westes/flex) (open source tool)
- Parser is implemented using [Bison](https://www.gnu.org/software/bison/) (open source tool)
- Code generator is implemented in a file .cpp called `driver.cpp`.
âšī¸ More details of the programming language implemented is on `/Front-End/Progetto_finale/`