Book Image

Getting started with LLVM core libraries

Book Image

Getting started with LLVM core libraries

Overview of this book

Table of Contents (17 chapters)
Getting Started with LLVM Core Libraries
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding the role of a static analyzer


In the overall LLVM design, a project belongs to the Clang frontend if it operates on the original source-code level (C/C++) since recovering source-level information at the LLVM IR is challenging. One of the most interesting Clang-based tools is the Clang Static Analyzer, a project that leverages a set of checkers to build elaborate bug reports, similar to what compiler warnings traditionally do at a smaller scale. Each checker tests for a specific rule violation.

As with classic warnings, a static analyzer helps the programmer in finding bugs early in the development cycle without the need to postpone bug detection to runtime. The analysis is done after parsing, but before further compilation. On the other hand, the tool may require a lot of time to process a large code base, which is a good reason why it is not integrated in the typical compilation flow. For example, the static analyzer alone may spend hours to process the entire LLVM source...