diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /include/llvm/Pass.h | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'include/llvm/Pass.h')
-rw-r--r-- | include/llvm/Pass.h | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index eea99e0..eb4c922 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -29,11 +29,8 @@ #ifndef LLVM_PASS_H #define LLVM_PASS_H -#include "llvm/Module.h" #include "llvm/Support/DataTypes.h" -#include "llvm/Support/Streams.h" #include <cassert> -#include <iosfwd> #include <utility> #include <vector> @@ -48,7 +45,8 @@ class ImmutablePass; class PMStack; class AnalysisResolver; class PMDataManager; -class LLVMContext; +class raw_ostream; +class StringRef; // AnalysisID - Use the PassInfo to identify a pass... typedef const PassInfo* AnalysisID; @@ -78,9 +76,6 @@ class Pass { void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT -protected: - LLVMContext* Context; - public: explicit Pass(intptr_t pid) : Resolver(0), PassID(pid) { assert(pid && "pid cannot be 0"); @@ -108,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. @@ -171,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 @@ -198,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; @@ -207,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 @@ -281,11 +276,8 @@ public: /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// - virtual bool doInitialization(Module &M) { - Context = &M.getContext(); - return false; - } - + virtual bool doInitialization(Module &M) { return false; } + /// runOnFunction - Virtual method overriden by subclasses to do the /// per-function processing of the pass. /// @@ -336,10 +328,7 @@ public: /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// - virtual bool doInitialization(Module &M) { - Context = &M.getContext(); - return false; - } + virtual bool doInitialization(Module &M) { return false; } /// doInitialization - Virtual method overridden by BasicBlockPass subclasses /// to do any necessary per-function initialization. |