Change the JIT to compile eagerly by default as agreed in
[oota-llvm.git] / include / llvm / Pass.h
index 3043fc0db5aef8d12a89428810ec17247d20e76f..6bef2e79b2a604a44ac49c6ad215f7312c50afff 100644 (file)
 #ifndef LLVM_PASS_H
 #define LLVM_PASS_H
 
-#include "llvm/Module.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/System/DataTypes.h"
 #include <cassert>
-#include <iosfwd>
 #include <utility>
 #include <vector>
 
@@ -48,6 +45,8 @@ class ImmutablePass;
 class PMStack;
 class AnalysisResolver;
 class PMDataManager;
+class raw_ostream;
+class StringRef;
 
 // AnalysisID - Use the PassInfo to identify a pass...
 typedef const PassInfo* AnalysisID;
@@ -104,9 +103,8 @@ public:
   /// provide the Module* in case the analysis doesn't need it it can just be
   /// ignored.
   ///
-  virtual void print(std::ostream &O, const Module *M) const;
-  void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); }
-  void dump() const; // dump - call print(std::cerr, 0);
+  virtual void print(raw_ostream &O, const Module *M) const;
+  void dump() const; // dump - Print to stderr.
 
   /// Each pass is responsible for assigning a pass manager to itself.
   /// PMS is the stack of available pass manager. 
@@ -167,6 +165,10 @@ public:
   // or null if it is not known.
   static const PassInfo *lookupPassInfo(intptr_t TI);
 
+  // lookupPassInfo - Return the pass info object for the pass with the given
+  // argument string, or null if it is not known.
+  static const PassInfo *lookupPassInfo(const StringRef &Arg);
+
   /// getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to
   /// get analysis information that might be around, for example to update it.
   /// This is different than getAnalysis in that it can fail (if the analysis
@@ -194,7 +196,7 @@ public:
   AnalysisType &getAnalysis() const; // Defined in PassAnalysisSupport.h
 
   template<typename AnalysisType>
-  AnalysisType &getAnalysis(Function &F); // Defined in PassanalysisSupport.h
+  AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h
 
   template<typename AnalysisType>
   AnalysisType &getAnalysisID(const PassInfo *PI) const;
@@ -203,9 +205,6 @@ public:
   AnalysisType &getAnalysisID(const PassInfo *PI, Function &F);
 };
 
-inline std::ostream &operator<<(std::ostream &OS, const Pass &P) {
-  P.print(OS, 0); return OS;
-}
 
 //===----------------------------------------------------------------------===//
 /// ModulePass class - This class is used to implement unstructured
@@ -277,7 +276,7 @@ public:
   /// doInitialization - Virtual method overridden by subclasses to do
   /// any necessary per-module initialization.
   ///
-  virtual bool doInitialization(Module &M) { return false; }
+  virtual bool doInitialization(Module &) { return false; }
   
   /// runOnFunction - Virtual method overriden by subclasses to do the
   /// per-function processing of the pass.
@@ -329,7 +328,7 @@ public:
   /// doInitialization - Virtual method overridden by subclasses to do
   /// any necessary per-module initialization.
   ///
-  virtual bool doInitialization(Module &M) { return false; }
+  virtual bool doInitialization(Module &) { return false; }
 
   /// doInitialization - Virtual method overridden by BasicBlockPass subclasses
   /// to do any necessary per-function initialization.