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
Getting started with LLVM core libraries

You're reading from   Getting started with LLVM core libraries Get to grips with LLVM essentials and use the core libraries to build advanced tools

Arrow left icon
Product type Paperback
Published in Aug 2014
Publisher Packt
ISBN-13 9781782166924
Length 314 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Build and Install LLVM 2. External Projects FREE CHAPTER 3. Tools and Design 4. The Frontend 5. The LLVM Intermediate Representation 6. The Backend 7. The Just-in-Time Compiler 8. Cross-platform Compilation 9. The Clang Static Analyzer 10. Clang Tools with LibTooling Index

What this book covers

Chapter 1, Build and Install LLVM, will show you how to install the Clang/LLVM package on Linux, Windows, or Mac, including a discussion about building LLVM on Visual Studio and Xcode. It will also discuss the different flavors of LLVM distributions and discuss which distribution is best for you: pre-built binaries, distribution packages, or source codes.

Chapter 2, External Projects, will present external LLVM projects that live in separate packages or repositories, such as extra Clang tools, the DragonEgg GCC plugin, the LLVM debugger (LLDB), and the LLVM test suite.

Chapter 3, Tools and Design, will explain how the LLVM project is organized in different tools, working out an example on how to use them to go from source code to assembly language. It will also present how the compiler driver works, and finally, how to write your very first LLVM tool.

Chapter 4, The Frontend, will present the LLVM compiler frontend, the Clang project. It will walk you through all the steps of the frontend while explaining how to write small programs that use each part of the frontend as it is presented. It finishes by explaining how to write a small compiler driver with Clang libraries.

Chapter 5, The LLVM Intermediate Representation, will explain a crucial part of the LLVM design: its intermediate representation. It will show you what characteristics make it special, present its syntax, structure, and how to write a tool that generates the LLVM IR.

Chapter 6, The Backend, will introduce you to the LLVM compiler backend, responsible for translating the LLVM IR to machine code. This chapter will walk you through all the backend steps and provide you with the knowledge to create your own LLVM backend. It finishes by showing you how to create a backend pass.

Chapter 7, The Just-in-Time Compiler, will explain the LLVM Just-in-Time compilation infrastructure, which allows you to generate and execute machine code on demand. This technology is essential in applications where the program source code is only known at runtime, such as JavaScript interpreters in Internet browsers. This chapter walks you through the steps to use the right libraries in order to create your own JIT compiler.

Chapter 8, Cross-platform Compilation, will guide you through the steps for Clang/LLVM to create programs for other platforms such as ARM-based ones. This involves configuring the right environment to correctly compile programs that will run outside the environment where they were compiled.

Chapter 9, The Clang Static Analyzer, will present a powerful tool for discovering bugs in large source code bases without even running the program, but simply by analyzing the code. This chapter will also show you how to extend the Clang Static Analyzer with your own bug checkers.

Chapter 10, Clang Tools with LibTooling, will present the LibTooling framework and a series of Clang tools that are built upon this library, which allow you to perform source code refactoring or simply analyze the source code in an easy way. This chapter finishes by showing you how to write your own C++ source code refactoring tool by using this library.

At the time of this writing, LLVM 3.5 had not been released. While this book focuses on LLVM Version 3.4, we plan to release an appendix updating the examples in this book to LLVM 3.5 by the third week of September 2014, allowing you to exercise the content of the book with the newest versions of LLVM. This appendix will be available at https://www.packtpub.com/sites/default/files/downloads/6924OS_Appendix.pdf.

lock icon The rest of the chapter is locked
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