class Pass;
class StringRef;
class Value;
+ class Timer;
/// FunctionPassManager and PassManager, two top level managers, serve
/// as the public interface of pass manager infrastructure.
}
virtual ~PMDataManager();
+
+ virtual Pass *getAsPass() = 0;
/// Augment AvailableAnalysis by adding analysis made available by pass P.
void recordAvailableAnalysis(Pass *P);
/// verifyPreservedAnalysis -- Verify analysis presreved by pass P.
void verifyPreservedAnalysis(Pass *P);
- /// verifyDomInfo -- Verify dominator information if it is available.
- void verifyDomInfo(Pass &P, Function &F);
-
/// Remove Analysis that is not preserved by the pass
void removeNotPreservedAnalysis(Pass *P);
- /// Remove dead passes
- void removeDeadPasses(Pass *P, const StringRef &Msg,
+ /// Remove dead passes used by P.
+ void removeDeadPasses(Pass *P, StringRef Msg,
enum PassDebuggingString);
+ /// Remove P.
+ void freePass(Pass *P, StringRef Msg,
+ enum PassDebuggingString);
+
/// Add pass P into the PassVector. Update
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
void add(Pass *P, bool ProcessAnalysis = true);
/// through getAnalysis interface.
virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
- virtual Pass * getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) {
- assert (0 && "Unable to find on the fly pass");
- return NULL;
- }
+ virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F);
/// Initialize available analysis information.
void initializeAnalysisInfo() {
void dumpLastUses(Pass *P, unsigned Offset) const;
void dumpPassArguments() const;
void dumpPassInfo(Pass *P, enum PassDebuggingString S1,
- enum PassDebuggingString S2, const StringRef &Msg);
+ enum PassDebuggingString S2, StringRef Msg);
void dumpRequiredSet(const Pass *P) const;
void dumpPreservedSet(const Pass *P) const;
// then PMT_Last active pass mangers.
std::map<AnalysisID, Pass *> *InheritedAnalysis[PMT_Last];
+
+ /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions
+ /// or higher is specified.
+ bool isPassDebuggingExecutionsOrMore() const;
+
private:
- void dumpAnalysisUsage(const StringRef &Msg, const Pass *P,
- const AnalysisUsage::VectorType &Set) const;
+ void dumpAnalysisUsage(StringRef Msg, const Pass *P,
+ const AnalysisUsage::VectorType &Set) const;
// Set of available Analysis. This information is used while scheduling
- // pass. If a pass requires an analysis which is not not available then
- // equired analysis pass is scheduled to run before the pass itself is
+ // pass. If a pass requires an analysis which is not available then
+ // the required analysis pass is scheduled to run before the pass itself is
// scheduled to run.
std::map<AnalysisID, Pass*> AvailableAnalysis;
/// It batches all function passes and basic block pass managers together and
/// sequence them to process one function at a time before processing next
/// function.
-
class FPPassManager : public ModulePass, public PMDataManager {
-
public:
static char ID;
explicit FPPassManager(int Depth)
///
bool doFinalization(Module &M);
+ virtual PMDataManager *getAsPMDataManager() { return this; }
+ virtual Pass *getAsPass() { return this; }
+
/// Pass Manager itself does not invalidate any analysis info.
void getAnalysisUsage(AnalysisUsage &Info) const {
Info.setPreservesAll();
}
};
-}
+Timer *getPassTimer(Pass *);
-extern void StartPassTimer(llvm::Pass *);
-extern void StopPassTimer(llvm::Pass *);
+}
#endif