Chapter 10. Clang Tools with LibTooling

In this chapter, we will see how many tools use the Clang frontend as a library to manipulate C/C++ programs for different purposes. In particular, all of them rely on LibTooling, a Clang library that allows standalone tools to be written. In this case, instead of writing a plugin to fit into the Clang compilation pipeline, you design your very own tool that uses Clang parsing abilities, allowing your users to directly call your tool. The tools presented in this chapter are available in the Clang Extra Tools package; refer to Chapter 2, External Projects, for information on how to install them. We will finish this chapter with a working example of how to create your own code-refactoring tool. We will cover ...

Get Getting Started with LLVM Core Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.