Skip to content

abidmalikwaterloo/LLVM-Techniques-Tips-and-Best-Practices-Clang-and-Middle-End-Libraries

 
 

Repository files navigation

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries

This is the code repository for LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries, published by Packt.

Design powerful and reliable compilers using the latest libraries and tools from LLVM

What is this book about?

Every programmer or engineer, at some point in their career, works with compilers for optimizing their applications. Compilers convert a high-level programming language into low-level machine-executable code. LLVM provides the infrastructure, reusable libraries, and tools needed for developers to build their own compilers. With LLVM's extensive set of tooling, you can effectively generate code for different backends as well as optimize them.

This book covers the following exciting features:

  • Find out how LLVM’s build system works and how to reduce the building resource
  • Get to grips with running custom testing with LLVM’s LIT framework
  • Build different types of plugins and extensions for Clang
  • Customize Clang’s toolchain and compiler flags
  • Write LLVM passes for the new PassManager
  • Discover how to inspect and modify LLVM IR
  • Understand how to use LLVM’s profile-guided optimizations (PGO) framework
  • Create custom compiler sanitizers

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

clang -fplugin=/path/to/MyPlugin.so … foo.cpp

Following is what you need for this book: This book is for software engineers of all experience levels who work with LLVM. If you are an academic researcher, this book will help you learn useful LLVM skills in a short time and enable you to build your prototypes and projects quickly. Programming language enthusiasts will also find this book useful for building a new programming language with the help of LLVM.

With the following software and hardware list you can run all code files present in the book (Chapter 1-12).

Software and Hardware List

Chapter Software required OS required
1-12 LLVM version 12.x or later Mac OS X, or Linux (Any)
1-12 GCC version 5.1 or later Mac OS X, or Linux (Any)
1-12 CMake version 3.13.4 or later Mac OS X, or Linux (Any)
1-12 Python 3.x Mac OS X, or Linux (Any)
1-12 Ninja Build or GNU Make Mac OS X, or Linux (Any)
1-12 Graphviz Mac OS X, or Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Related products

Get to Know the Author

Min-Yih "Min" Hsu is a Ph.D. candidate in computer science at the University of California, Irvine. His research focuses on compiler engineering, code optimization, advanced hardware architectures, and system security. He has been an active member of the LLVM community since 2015 and has contributed numerous patches upstream. Min also dedicates his time to advocating LLVM and compiler engineering through various avenues, such as writing blog posts and giving talks at conferences. In his spare time, Min likes to explore a variety of different coffee beans and ways of brewing.

About

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries, published by Packt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.4%
  • CMake 24.6%