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

Chris Lattner sabre at nondot.org
Fri Dec 1 14:21:28 PST 2006



Changes in directory llvm/include/llvm:

PassSupport.h updated: 1.32 -> 1.33
---
Log message:

move 'cfgonly' pass tracking into PassInfo, instead of handling it with
yet-another global data structure.


---
Diffs of the changes:  (+11 -3)

 PassSupport.h |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/PassSupport.h
diff -u llvm/include/llvm/PassSupport.h:1.32 llvm/include/llvm/PassSupport.h:1.33
--- llvm/include/llvm/PassSupport.h:1.32	Fri Dec  1 16:00:50 2006
+++ llvm/include/llvm/PassSupport.h	Fri Dec  1 16:21:11 2006
@@ -38,6 +38,7 @@
   const char           *PassName;      // Nice name for Pass
   const char           *PassArgument;  // Command Line argument to run this pass
   const std::type_info &TypeInfo;      // type_info object for this Pass class
+  bool IsCFGOnlyPass;                  // Pass only looks at the CFG.
   bool IsAnalysisGroup;                // True if an analysis group.
   std::vector<const PassInfo*> ItfImpl;// Interfaces implemented by this pass
 
@@ -48,8 +49,8 @@
   /// through RegisterPass.
   PassInfo(const char *name, const char *arg, const std::type_info &ti,
            Pass *(*normal)() = 0)
-    : PassName(name), PassArgument(arg), TypeInfo(ti), IsAnalysisGroup(false),
-      NormalCtor(normal) {
+    : PassName(name), PassArgument(arg), TypeInfo(ti), 
+      IsCFGOnlyPass(false), IsAnalysisGroup(false), NormalCtor(normal) {
   }
 
   /// getPassName - Return the friendly name for the pass, never returns null
@@ -73,6 +74,11 @@
   bool isAnalysisGroup() const { return IsAnalysisGroup; }
   void SetIsAnalysisGroup() { IsAnalysisGroup = true; }
 
+  /// isCFGOnlyPass - return true if this pass only looks at the CFG for the
+  /// function.
+  bool isCFGOnlyPass() const { return IsCFGOnlyPass; }
+  void SetIsCFGOnlyPass() { IsCFGOnlyPass = true; }
+  
   /// getNormalCtor - Return a pointer to a function, that when called, creates
   /// an instance of the pass and returns it.  This pointer may be null if there
   /// is no default constructor for the pass.
@@ -159,7 +165,9 @@
   /// setOnlyUsesCFG - Notice that this pass only depends on the CFG, so
   /// transformations that do not modify the CFG do not invalidate this pass.
   ///
-  void setOnlyUsesCFG();
+  void setOnlyUsesCFG() {
+    PIObj.SetIsCFGOnlyPass();
+  }
 };
 
 template<typename PassName>






More information about the llvm-commits mailing list