[llvm-commits] CVS: llvm/include/llvm/Pass.h

Devang Patel dpatel at apple.com
Mon Mar 5 17:06:38 PST 2007



Changes in directory llvm/include/llvm:

Pass.h updated: 1.79 -> 1.80
---
Log message:

Add preparePassManager() hook. This allows each pass to check whether
current active pass manager is appropriate or not. 

A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other 
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this  hook 
and use new LPPassManager for itself.


---
Diffs of the changes:  (+5 -0)

 Pass.h |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/Pass.h
diff -u llvm/include/llvm/Pass.h:1.79 llvm/include/llvm/Pass.h:1.80
--- llvm/include/llvm/Pass.h:1.79	Thu Jan 25 18:23:00 2007
+++ llvm/include/llvm/Pass.h	Mon Mar  5 19:06:16 2007
@@ -119,8 +119,13 @@
   void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); }
   void dump() const; // dump - call print(std::cerr, 0);
 
+  /// Each pass is responsible for assigning a pass manager to itself.
+  /// PMS is the stack of available pass manager. 
   virtual void assignPassManager(PMStack &PMS, 
 				 PassManagerType T = PMT_Unknown) {}
+  /// Check if available pass managers are suitable for this pass or not.
+  virtual void preparePassManager(PMStack &PMS) {}
+
   // Access AnalysisResolver
   inline void setResolver(AnalysisResolver *AR) { Resolver = AR; }
   inline AnalysisResolver *getResolver() { return Resolver; }






More information about the llvm-commits mailing list