X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FPass.h;h=6bef2e79b2a604a44ac49c6ad215f7312c50afff;hb=24f934d0551e33508c4ffd24318ea0e970db9810;hp=923de658c3b95e33006fcb33dbf187322d9cbef6;hpb=8a7eed32678cf6cb3cf29c77a7fa67abc6450aa9;p=oota-llvm.git diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 923de658c3b..6bef2e79b2a 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -29,10 +29,8 @@ #ifndef LLVM_PASS_H #define LLVM_PASS_H -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/Streams.h" +#include "llvm/System/DataTypes.h" #include -#include #include #include @@ -47,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; @@ -75,6 +75,7 @@ class Pass { void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT + public: explicit Pass(intptr_t pid) : Resolver(0), PassID(pid) { assert(pid && "pid cannot be 0"); @@ -102,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. @@ -165,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() - 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 @@ -192,7 +196,7 @@ public: AnalysisType &getAnalysis() const; // Defined in PassAnalysisSupport.h template - AnalysisType &getAnalysis(Function &F); // Defined in PassanalysisSupport.h + AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h template AnalysisType &getAnalysisID(const PassInfo *PI) const; @@ -201,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 @@ -276,7 +277,7 @@ public: /// any necessary per-module initialization. /// virtual bool doInitialization(Module &) { return false; } - + /// runOnFunction - Virtual method overriden by subclasses to do the /// per-function processing of the pass. ///