📜 ⬆️ ⬇️

The book “Getting Started with LLVM Core Libraries” has been released.

I think many, as well as me, the book “Getting Started with LLVM Core Libraries” will seem interesting. This is the first book devoted entirely and entirely to LLVM. Basically, as the name implies, is aimed at beginners, who only turned their attention to LLVM, but already have experience programming in C ++.

Chapter 1. Building and Installing LLVM. describes the installation of Clang / LLVM on Linux, Windows, Mac (with a description of how to build this library on Visual Studio and Xcode). It also discusses the question of what and when to choose - download the already compiled binary files, use the package manager, or compile the source code yourself.

Chapter 2. External projects. Contains a description of projects that are not part of the library core. For example: additional utilities of Clang, DragonEgg - plugin for GCC, LLDB debugger and LLVM test suite.

Chapter 3. Tools and architecture of the project. Explains how the interaction of various components is established in LLVM. Provides an example of step-by-step translation from source code to assembler. Also describes how the compiler driver works and, finally, how to write your first utility using LLVM.
')
Chapter 4. Compiler . Describes the Clang project tools and how to write a utility using these tools.

Chapter 5. Intermediate Representation of LLVM. Describes one of the most important parts of LLVM - the intermediate representation code (intermediate representation - IR). It describes its syntax, structure, which makes it so important and how to write a program that produces such code.

Chapter 6. Machine Code Generator. Describes the part of the LLVM responsible for generating the machine code from IR. Here is enough information to create your own generator.

Chapter 7. Compiler Just-in-Time (JIT). LLVM tools that provide JIT compilation are described, and an example of creating your own JIT compiler is given.

Chapter 8. Cross-platform compilation. An explanation is given of how using Clang / LLVM to create a program designed to run on other platforms (for example, on ARM). Describes how to configure the environment for performing such compilations.

Chapter 9. Clang's Static Analyzer . This analyzer and ways to extend its functionality with its utilities are described.

Chapter 10. LibTooling Library. This library (framework) is described, which allows refractoring of the source code. It also describes an example of creating your own code refractoring utility based on LibTooling.

At the time of writing of the book (August 2014), LLVM 3.5 was not yet released, therefore all examples are executed for LLVM 3.4. However, the authors promise in time to make an addition (free) to the book, translate all the examples into LLVM 3.5 and place on the publisher's website.

Briefly about the authors:
Bruno Cordoso Lopes - participated in the development of LLVM since 2007. Inside this project, he took part in the development of the MIPS code generator, supporting x86 AVX, improving the assembler code for ARM.
Rafael Auler - did not directly participate in the development of LLVM. However, his PhD research is related to LLVM.

The list of reviewers includes people known in LLVM (such as Eli Bendersky), upsetting Lattner's absence, but apparently he is very busy. In general, the book is easy to read. It does not hurt, and often will help, those who want to start using LLVM.

Source: https://habr.com/ru/post/241577/


All Articles