#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>
class PMStack;
class AnalysisResolver;
class PMDataManager;
+class raw_ostream;
+class StringRef;
// AnalysisID - Use the PassInfo to identify a pass...
typedef const PassInfo* AnalysisID;
/// 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.
// 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
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;
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
/// 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.
/// 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.