A guide that explains how high level programming language constructs are mapped to the LLVM intermediate language.
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_build Converted to sphinx/rst and improved some things along the way Oct 19, 2017
_original_post Converted to sphinx/rst and improved some things along the way Oct 19, 2017
a-quick-primer updated quick primer a bit Oct 20, 2017
advanced-constructs Converted to sphinx/rst and improved some things along the way Oct 19, 2017
appendix-a-how-to-implement-a-string-type-in-llvm Converted to sphinx/rst and improved some things along the way Oct 19, 2017
basic-constructs basic-constructs/functions.rst: fix function type and getelementptr i… Jun 28, 2018
control-structures added a short chapter on SSA form and how phi is implemented on the m… Jun 27, 2018
epilogue Update resources.rst Jun 27, 2018
exception-handling Converted to sphinx/rst and improved some things along the way Oct 19, 2017
interfacing-to-the-operating-system moved inline listing to literalinclude Jan 16, 2019
interoperating-with-a-runtime-library Converted to sphinx/rst and improved some things along the way Oct 19, 2017
object-oriented-constructs Fix mistake in classes.rst Oct 5, 2018
.gitignore updated gitignore with python stuff and _build dir Jun 27, 2018
LICENSE.md added license, udpated README Sep 15, 2017
Makefile Converted to sphinx/rst and improved some things along the way Oct 19, 2017
README.rst removed some unnecessary features from main .rst file Oct 19, 2017
common.mk added a short chapter on SSA form and how phi is implemented on the m… Jun 27, 2018
conf.py updated year Jun 27, 2018
make.bat Converted to sphinx/rst and improved some things along the way Oct 19, 2017

README.rst

Mapping High Level Constructs to LLVM IR

Click here to read the book on readthedocs.org

About

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.

Contributing

The repository for this gitbook is hosted on github. All contributions are welcome. If you find an error file an Issue or fork the repository and create a pull-request.

License

UNLESS OTHERWISE NOTED, THE CONTENTS OF THIS REPOSITORY/DOCUMENT ARE LICENSED UNDER THE CREATIVE COMMONS ATTRIBUTION - SHARE ALIKE 4.0 INTERNATIONAL LICENSE

.. toctree::
   :maxdepth: 1
   :caption: Contents:

   a-quick-primer/index
   basic-constructs/index
   control-structures/index
   object-oriented-constructs/index
   exception-handling/index
   advanced-constructs/index
   interoperating-with-a-runtime-library/index
   interfacing-to-the-operating-system/index
   epilogue/index
   appendix-a-how-to-implement-a-string-type-in-llvm/index