PassManager.h revision 18961504fc2b299578dba817900a0696cf3ccc4d
1//===- llvm/PassManager.h - Container for Passes -----------------*- C++ -*--=// 2// 3// This file defines the PassManager class. This class is used to hold, 4// maintain, and optimize execution of Pass's. The PassManager class ensures 5// that analysis results are available before a pass runs, and that Pass's are 6// destroyed when the PassManager is destroyed. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef LLVM_PASSMANAGER_H 11#define LLVM_PASSMANAGER_H 12 13class Pass; 14class Module; 15template<class UnitType> class PassManagerT; 16 17class PassManager { 18 PassManagerT<Module> *PM; // This is a straightforward Pimpl class 19public: 20 PassManager(); 21 ~PassManager(); 22 23 // add - Add a pass to the queue of passes to run. This passes ownership of 24 // the Pass to the PassManager. When the PassManager is destroyed, the pass 25 // will be destroyed as well, so there is no need to delete the pass. This 26 // implies that all passes MUST be allocated with 'new'. 27 // 28 void add(Pass *P); 29 30 // run - Execute all of the passes scheduled for execution. Keep track of 31 // whether any of the functions modifies the program, and if so, return true. 32 // 33 bool run(Module &M); 34}; 35 36#endif 37