A guide that explains how high level programming language constructs are mapped to the LLVM intermediate language.
See the code[!CAUTION] The LLVM code listing in this repository are pretty much out-of-date and do not work with recent LLVM versions (e.g., this was written before opaque pointers became a thing in LLVM). Treat everything with caution. Feel free to fork and send PRs, but do not expect any major updates to this guide.
This is a gitbook dedicated to providing a description on how LLVM based compilers map high-level language constructs into the LLVM intermediate representation (IR).
This document targets people interested in how modern compilers work and want to learn how high-level language constructs can be implemented. Currently the books focuses on C and C++, but contributions about other languages targeting LLVM are highly welcome. This document should help to make the learning curve less steep for aspiring LLVM users.
For the sake of simplicity, we'll be working with a 32-bit target machine so that pointers and word-sized operands are 32-bits. Also, for the sake of readability we do not mangle (encode) names. Rather, they are given simple, easy-to-read names that reflect their purpose. A production compiler for any language that supports overloading would generally need to mangle the names so as to avoid conflicts between symbols.
Read the book online at ReadTheDocs.
This section presents various external links of relevance to those studying LLVM IR:
If you have other relevant links, please open an issue or submit a pull request with the link added to the list above.
All contributions are welcome!
The repository is on GitHub.
If you find an error, file an issue or create a pull request.
You can build the book in one of two ways: Using Ubuntu Linux or Docker on Linux.
cd ~git clone https://github.com/f0rki/mapping-high-level-constructs-to-llvm-ir llvm-ircd llvm-irsudo apt install -y build-essentialsudo apt install -y python3-pipsudo apt install -y python3-sphinxsudo apt install -y python3-sphinx-rtd-themeYou can now build the documentation locally:
make html._build/html folder.sudo make docker-build.sudo make docker-make O=html._build/html folder.UNLESS OTHERWISE NOTED, THE CONTENTS OF THIS REPOSITORY/DOCUMENT ARE LICENSED UNDER THE CREATIVE COMMONS ATTRIBUTION - SHARE ALIKE 4.0 INTERNATIONAL LICENSE
(top 24 of 43)
463 followers · starred Apr 2019
369 followers · starred Nov 2021
195 followers · starred May 2020
848 followers · starred Jun 2023
A guide that explains how high level programming language constructs are mapped to the LLVM intermediate language.
See the code[!CAUTION] The LLVM code listing in this repository are pretty much out-of-date and do not work with recent LLVM versions (e.g., this was written before opaque pointers became a thing in LLVM). Treat everything with caution. Feel free to fork and send PRs, but do not expect any major updates to this guide.
This is a gitbook dedicated to providing a description on how LLVM based compilers map high-level language constructs into the LLVM intermediate representation (IR).
This document targets people interested in how modern compilers work and want to learn how high-level language constructs can be implemented. Currently the books focuses on C and C++, but contributions about other languages targeting LLVM are highly welcome. This document should help to make the learning curve less steep for aspiring LLVM users.
For the sake of simplicity, we'll be working with a 32-bit target machine so that pointers and word-sized operands are 32-bits. Also, for the sake of readability we do not mangle (encode) names. Rather, they are given simple, easy-to-read names that reflect their purpose. A production compiler for any language that supports overloading would generally need to mangle the names so as to avoid conflicts between symbols.
Read the book online at ReadTheDocs.
This section presents various external links of relevance to those studying LLVM IR:
If you have other relevant links, please open an issue or submit a pull request with the link added to the list above.
All contributions are welcome!
The repository is on GitHub.
If you find an error, file an issue or create a pull request.
You can build the book in one of two ways: Using Ubuntu Linux or Docker on Linux.
cd ~git clone https://github.com/f0rki/mapping-high-level-constructs-to-llvm-ir llvm-ircd llvm-irsudo apt install -y build-essentialsudo apt install -y python3-pipsudo apt install -y python3-sphinxsudo apt install -y python3-sphinx-rtd-themeYou can now build the documentation locally:
make html._build/html folder.sudo make docker-build.sudo make docker-make O=html._build/html folder.UNLESS OTHERWISE NOTED, THE CONTENTS OF THIS REPOSITORY/DOCUMENT ARE LICENSED UNDER THE CREATIVE COMMONS ATTRIBUTION - SHARE ALIKE 4.0 INTERNATIONAL LICENSE
(top 24 of 43)
463 followers · starred Apr 2019
369 followers · starred Nov 2021
195 followers · starred May 2020
848 followers · starred Jun 2023