Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
LLVM Essentials

You're reading from   LLVM Essentials Become familiar with the LLVM infrastructure and start using LLVM libraries to design a compiler

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785280801
Length 166 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Suyog Sarda Suyog Sarda
Author Profile Icon Suyog Sarda
Suyog Sarda
Mayur Pandey Mayur Pandey
Author Profile Icon Mayur Pandey
Mayur Pandey
David Farago David Farago
Author Profile Icon David Farago
David Farago
John Criswell John Criswell
Author Profile Icon John Criswell
John Criswell
Arrow right icon
View More author details
Toc

Chapter 1. Playing with LLVM

The LLVM Compiler infrastructure project, started in 2000 in University of Illinois, was originally a research project to provide modern, SSA based compilation technique for arbitrary static and dynamic programming languages. Now it has grown to be an umbrella project with many sub projects within it, providing a set of reusable libraries having well defined interfaces.

LLVM is implemented in C++ and the main crux of it is the LLVM core libraries it provides. These libraries provide us with opt tool, the target independent optimizer, and code generation support for various target architectures. There are other tools which make use of core libraries, but our main focus in the book will be related to the three mentioned above. These are built around LLVM Intermediate Representation (LLVM IR), which can almost map all the high-level languages. So basically, to use LLVM's optimizer and code generation technique for code written in a certain programming language, all we need to do is write a frontend for a language that takes the high level language and generates LLVM IR. There are already many frontends available for languages such as C, C++, Go, Python, and so on. We will cover the following topics in this chapter:

  • Modular design and collection of libraries
  • Getting familiar with LLVM IR
  • LLVM Tools and using them at command line
You have been reading a chapter from
LLVM Essentials
Published in: Dec 2015
Publisher:
ISBN-13: 9781785280801
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime