Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Clang Compiler Frontend
  • Table Of Contents Toc
Clang Compiler Frontend

Clang Compiler Frontend

By : Ivan Murashko
5 (1)
close
close
Clang Compiler Frontend

Clang Compiler Frontend

5 (1)
By: Ivan Murashko

Overview of this book

Discover the power of Clang, a versatile compiler known for its compilation speed and insightful error and warning messages. This book will get you acquainted with the capabilities of Clang, helping you harness its features for performance improvements and modularity by creating custom compiler tools. While focused on Clang compiler frontend, this book also covers other parts of LLVM, essential to understanding Clang's functionality, to keep up with the constantly evolving LLVM project. Starting with LLVM fundamentals, from installation procedures to development tools, this book walks you through Clang's internal architecture and its integral role within LLVM. As you progress, you’ll also tackle optimizing compilation performance through features such as C++ modules and header maps. The later chapters cover tools developed using the Clang/LLVM, including clang-tidy for linting, refactoring tools, and IDE support, and feature many examples to illustrate the material. By the end of this book, you’ll have a solid understanding of Clang, different Clang Tools, and how to use them to their fullest potential.
Table of Contents (17 chapters)
close
close
Lock Free Chapter
1
Part I: Clang Setup and Architecture
6
Part II: Clang Tools
11
Part III: Appendix
12
Bibliography

Preface

Low Level Virtual Machine (LLVM), is a collection of modular and reusable compiler and toolchain technologies used to develop compilers and compiler tools, such as linters and refactoring tools. LLVM is written in C++ and can be considered a good example of a well-structured project that uses interesting techniques aimed at making it reusable and efficient. The project can also be considered an excellent example of compiler architecture; diving into it will give you a sense of how compilers are organized and how they function. This should help to understand usage patterns and apply them accordingly.

One of the key components of LLVM is the C/C++ compiler known as Clang. This compiler is widely used across various companies and has been designated as the default compiler for certain development environments, notably for macOS development. Clang will be the primary focus of our investigation in this book, with particular attention to its frontend—the part that is closest to the C/C++ programming language. Specifically, the book will include examples demonstrating how the C++ standard is implemented within the compiler.

A pivotal aspect of LLVM’s design is its modularity, which facilitates the creation of custom tools that exploit the compiler’s comprehensive capabilities. A notable example covered in the book is the Clang-Tidy linter framework, designed to identify undesirable code patterns and recommend corrections. Although it includes several hundred checks, you may not find one specific to your project’s needs. However, the book will provide you with the foundation necessary to develop such a check from the beginning.

LLVM is an actively evolving project with two major releases each year. At the time the book was written, the latest stable release was version 17. Meanwhile, a release candidate for version 18 was introduced in January 2024, with its official release anticipated to coincide with the publication of the book. The book’s content has been verified against the latest compiler version, 18, ensuring it provides insights based on the most current compiler implementation available.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Clang Compiler Frontend
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon