Brussels / 1 & 2 February 2014

schedule

LDC - the LLVM-based D compiler

Using LLVM as backend for a D compiler


D is a language with C-like syntax and static typing. It pragmatically combines efficiency, control, and modeling power, with safety and programmer productivity. LDC is a fully open source, portable D compiler which uses LLVM as backend. In my talk, I will introduce the overall architecture of LDC first. I will then use the mapping of the front end AST to LLVM IR to show the required LLVM features. Experiences with LLVM in general, porting to other LLVM backends and integrating features like the AddressSanitizer are highlighted. At last, areas of improvement for LLVM are shown from the perspective of a D compiler (ABI, vararg, exception handling).

D is a language with C-like syntax and static typing. It pragmatically combines efficiency, control, and modeling power, with safety and programmer productivity. Because of its features major companies start to adopt D.

LDC is a fully open source, portable D compiler. It uses the frontend from the reference compiler combined with LLVM as backend to produce efficient native code. LDC targets x86/x86_64 systems like Linux, OS X and Windows and also Linux/PPC64. Ports to other architectures like ARM are underway. Currently, LDC can be built with LLVM 3.1 and all later LLVM releases.

In my talk, I introduce the overall architecture of LDC first. Using the frontend AST as starting point I show how types, statements and expression are mapped to LLVM IR and which LLVM features are required. Experiences with LLVM in general, porting to other LLVM backends than x86 and integrating features like the AddressSanitizer are highlighted. At last, areas of improvement for LLVM are shown from the perspective of a D compiler (ABI, vararg, exception handling).

Speakers

Kai Nacke

Attachments

Links