O'Reilly logo

LLVM Essentials by Mayur Pandey, Suyog Sarda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pass and Pass Manager

LLVM's Pass infrastructure is one of the many important features of the LLVM system. There are a number of analysis and optimization passes that can be run using this infrastructure. The starting point for LLVM passes is the Pass class, which is a superclass of all the passes. We need to inherit from some predefined subclasses taking into account what our pass is going to implement.

  • ModulePass: This is the most general superclass. By inheriting this class we allow the entire module to be analyzed at once. The functions within the module may not be referred to in a particular order. To use it, write a subclass that inherits from the ModulePass subclass and overloads the runOnModule function.

    Note

    Before going ahead with the discussion ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required