-//===- RegionPass.h - RegionPass class ------------------------------------===//
+//===- RegionPass.h - RegionPass class --------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_REGION_PASS_H
-#define LLVM_REGION_PASS_H
+#ifndef LLVM_ANALYSIS_REGIONPASS_H
+#define LLVM_ANALYSIS_REGIONPASS_H
#include "llvm/Analysis/RegionInfo.h"
-
+#include "llvm/IR/Function.h"
+#include "llvm/IR/LegacyPassManagers.h"
#include "llvm/Pass.h"
-#include "llvm/PassManagers.h"
-#include "llvm/Function.h"
-
#include <deque>
namespace llvm {
/// @brief Get a pass to print the LLVM IR in the region.
///
- /// @param O The ouput stream to print the Region.
- /// @param Banner The banner to seperate different printed passes.
+ /// @param O The output stream to print the Region.
+ /// @param Banner The banner to separate different printed passes.
///
/// @return The pass to print the LLVM IR in the region.
- Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+ Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const override;
+
+ using llvm::Pass::doInitialization;
+ using llvm::Pass::doFinalization;
virtual bool doInitialization(Region *R, RGPassManager &RGM) { return false; }
virtual bool doFinalization() { return false; }
/// @name PassManager API
///
//@{
- void preparePassManager(PMStack &PMS);
+ void preparePassManager(PMStack &PMS) override;
- virtual void assignPassManager(PMStack &PMS,
- PassManagerType PMT = PMT_RegionPassManager);
+ void assignPassManager(PMStack &PMS,
+ PassManagerType PMT = PMT_RegionPassManager) override;
- virtual PassManagerType getPotentialPassManagerType() const {
+ PassManagerType getPotentialPassManagerType() const override {
return PMT_RegionPassManager;
}
//@}
public:
static char ID;
- explicit RGPassManager(int Depth);
+ explicit RGPassManager();
/// @brief Execute all of the passes scheduled for execution.
///
/// @return True if any of the passes modifies the function.
- bool runOnFunction(Function &F);
+ bool runOnFunction(Function &F) override;
/// Pass Manager itself does not invalidate any analysis info.
/// RGPassManager needs RegionInfo.
- void getAnalysisUsage(AnalysisUsage &Info) const;
+ void getAnalysisUsage(AnalysisUsage &Info) const override;
- virtual const char *getPassName() const {
+ const char *getPassName() const override {
return "Region Pass Manager";
}
- virtual PMDataManager *getAsPMDataManager() { return this; }
- virtual Pass *getAsPass() { return this; }
+ PMDataManager *getAsPMDataManager() override { return this; }
+ Pass *getAsPass() override { return this; }
/// @brief Print passes managed by this manager.
- void dumpPassStructure(unsigned Offset);
+ void dumpPassStructure(unsigned Offset) override;
- /// @brief Print passes contained by this manager.
+ /// @brief Get passes contained by this manager.
Pass *getContainedPass(unsigned N) {
assert(N < PassVector.size() && "Pass number out of range!");
Pass *FP = static_cast<Pass *>(PassVector[N]);
return FP;
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_RegionPassManager;
}
};
-} // End llvm namespace
+} // namespace llvm
#endif