We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Roll your own compiler with LLVM

Formal Metadata

Title
Roll your own compiler with LLVM
Subtitle
Easy IR generation
Title of Series
Number of Parts
561
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
A close look at IR code generation inside a Modula-2 compiler. With LLVM, one of the main tasks of an compiler engineer is to design the IR code generation from an abstract syntax tree (AST). How easy is it? Although I have worked with and on LLVM for several years now I have not yet written an compiler from scratch. So I began to work on my own compiler for an simple yet powerful language: Modula-2. In this talk I introduce the architecture of the m2lang compiler. My main focus is the generation of basic blocks and IR code from the AST. I show which general patterns emerged and which areas of the languages caused trouble. I also give hints when it is useful to introduce yet another intermediate language between the AST and the IR.