Remove uses of llvm/System/IncludeFile.h that are no longer needed.
[oota-llvm.git] / include / llvm / PassSupport.h
index f594d45f1522b83cd73d288662cf226131ae2b9c..29e7374815373d0af8ae405d500c8699262982d4 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -21,7 +21,6 @@
 #ifndef LLVM_PASS_SUPPORT_H
 #define LLVM_PASS_SUPPORT_H
 
-#include "llvm/System/IncludeFile.h"
 // No need to include Pass.h, we are being included by it!
 
 namespace llvm {
@@ -39,6 +38,7 @@ class PassInfo {
   const char           *PassArgument;  // Command Line argument to run this pass
   intptr_t             PassID;      
   bool IsCFGOnlyPass;                  // Pass only looks at the CFG.
+  bool IsAnalysis;                     // True if an analysis pass.
   bool IsAnalysisGroup;                // True if an analysis group.
   std::vector<const PassInfo*> ItfImpl;// Interfaces implemented by this pass
 
@@ -48,9 +48,10 @@ public:
   /// PassInfo ctor - Do not call this directly, this should only be invoked
   /// through RegisterPass.
   PassInfo(const char *name, const char *arg, intptr_t pi,
-           Pass *(*normal)() = 0, bool isCFGOnly = false)
+           Pass *(*normal)() = 0, bool isCFGOnly = false, bool isAnalysis = false)
     : PassName(name), PassArgument(arg), PassID(pi), 
-      IsCFGOnlyPass(isCFGOnly), IsAnalysisGroup(false), NormalCtor(normal) {
+      IsCFGOnlyPass(isCFGOnly), 
+      IsAnalysis(isAnalysis), IsAnalysisGroup(false), NormalCtor(normal) {
   }
 
   /// getPassName - Return the friendly name for the pass, never returns null
@@ -64,7 +65,7 @@ public:
   ///
   const char *getPassArgument() const { return PassArgument; }
 
-  /// getTypeInfo - Return the type_info object for the pass...
+  /// getTypeInfo - Return the id object for the pass...
   /// TODO : Rename
   intptr_t getTypeInfo() const { return PassID; }
 
@@ -72,6 +73,7 @@ public:
   /// pass.
   ///
   bool isAnalysisGroup() const { return IsAnalysisGroup; }
+  bool isAnalysis() const { return IsAnalysis; }
   void SetIsAnalysisGroup() { IsAnalysisGroup = true; }
 
   /// isCFGOnlyPass - return true if this pass only looks at the CFG for the
@@ -140,11 +142,12 @@ struct RegisterPassBase {
   typedef Pass* (*NormalCtor_t)();
   
   RegisterPassBase(const char *Name, const char *Arg, intptr_t TI,
-                   NormalCtor_t NormalCtor = 0, bool CFGOnly = false)
-    : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) {
+                   NormalCtor_t NormalCtor = 0, bool CFGOnly = false, 
+                   bool IsAnalysis = false)
+    : PIObj(Name, Arg, TI, NormalCtor, CFGOnly, IsAnalysis) {
     registerPass();
   }
-  RegisterPassBase(intptr_t TI)
+  explicit RegisterPassBase(intptr_t TI)
     : PIObj("", "", TI) {
     // This ctor may only be used for analysis groups: it does not auto-register
     // the pass.
@@ -164,9 +167,11 @@ template<typename PassName>
 struct RegisterPass : public RegisterPassBase {
 
   // Register Pass using default constructor...
-  RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false)
-    : RegisterPassBase(Name, PassArg, (intptr_t)&PassName::ID,
-                     (RegisterPassBase::NormalCtor_t)callDefaultCtor<PassName>, CFGOnly) {
+  RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
+               bool IsAnalysis = false)
+    : RegisterPassBase(Name, PassArg, intptr_t(&PassName::ID),
+                      RegisterPassBase::NormalCtor_t(callDefaultCtor<PassName>),
+                      CFGOnly, IsAnalysis) {
   }
 };
 
@@ -204,12 +209,12 @@ protected:
 template<typename Interface, bool Default = false>
 struct RegisterAnalysisGroup : public RegisterAGBase {
   explicit RegisterAnalysisGroup(RegisterPassBase &RPB)
-    : RegisterAGBase((intptr_t) &Interface::ID, RPB.getPassInfo()->getTypeInfo(),
+    : RegisterAGBase(intptr_t(&Interface::ID), RPB.getPassInfo()->getTypeInfo(),
                      Default) {
   }
 
   explicit RegisterAnalysisGroup(const char *Name)
-    : RegisterAGBase((intptr_t) &Interface::ID) {
+    : RegisterAGBase(intptr_t(&Interface::ID)) {
     setGroupName(Name);
   }
 };