X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FPassManagers.h;h=1aa0d3a6fa427cc64114ea9d4db5ac428d06cff8;hb=47128fe2969b90880c5ffdbeb8c699a06bbaa9f9;hp=22d5062b6b1676e2e1a1b645945858ab14379c3f;hpb=d68a07650cdb2e18f18f362ba533459aa10e01b6;p=oota-llvm.git diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index 22d5062b6b1..1aa0d3a6fa4 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -88,7 +88,12 @@ // MPPassManagers. //===----------------------------------------------------------------------===// +#include "llvm/Support/PrettyStackTrace.h" + namespace llvm { + class Pass; + class Value; + class Module; /// FunctionPassManager and PassManager, two top level managers, serve /// as the public interface of pass manager infrastructure. @@ -109,6 +114,25 @@ enum PassDebuggingString { ON_CG_MSG // "' on Call Graph ...\n'" }; +/// PassManagerPrettyStackEntry - This is used to print informative information +/// about what pass is running when/if a stack trace is generated. +class PassManagerPrettyStackEntry : public PrettyStackTraceEntry { + Pass *P; + Value *V; + Module *M; +public: + PassManagerPrettyStackEntry(Pass *p) + : P(p), V(0), M(0) {} // When P is releaseMemory'd. + PassManagerPrettyStackEntry(Pass *p, Value &v) + : P(p), V(&v), M(0) {} // When P is run on V + PassManagerPrettyStackEntry(Pass *p, Module &m) + : P(p), V(0), M(&m) {} // When P is run on M + + /// print - Emit information about this stack frame to OS. + virtual void print(raw_ostream &OS) const; +}; + + //===----------------------------------------------------------------------===// // PMStack // @@ -384,12 +408,15 @@ class FPPassManager : public ModulePass, public PMDataManager { public: static char ID; explicit FPPassManager(int Depth) - : ModulePass(intptr_t(&ID)), PMDataManager(Depth) { } + : ModulePass(&ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. bool runOnFunction(Function &F); bool runOnModule(Module &M); + + /// cleanup - After running all passes, clean up pass manager cache. + void cleanup(); /// doInitialization - Run all of the initializers for the function passes. ///