[Refactor] Use virtual and override appropriately
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>
Sun, 1 Mar 2015 18:42:08 +0000 (18:42 +0000)
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>
Sun, 1 Mar 2015 18:42:08 +0000 (18:42 +0000)
  + Add override for overwritten methods.
  + Remove virtual for methods we do not want to be overwritten.

llvm-svn: 230898

polly/include/polly/Dependences.h
polly/include/polly/ScopPass.h
polly/lib/CodeGen/IslCodeGeneration.cpp
polly/lib/Transform/DeadCodeElimination.cpp
polly/lib/Transform/ScheduleOptimizer.cpp

index 71eb6e9..9bbddb6 100644 (file)
@@ -124,10 +124,10 @@ public:
   /// @brief Recompute dependences from schedule and memory accesses.
   void recomputeDependences();
 
-  bool runOnScop(Scop &S);
-  void printScop(raw_ostream &OS, Scop &S) const;
-  virtual void releaseMemory();
-  virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+  bool runOnScop(Scop &S) override;
+  void printScop(raw_ostream &OS, Scop &S) const override;
+  void releaseMemory() override;
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
 
 private:
   Scop *S;
index 13e7bfb..55734af 100644 (file)
@@ -47,7 +47,7 @@ protected:
   /// getAnalysisUsage - Subclasses that override getAnalysisUsage
   /// must call this.
   ///
-  virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+  virtual void getAnalysisUsage(AnalysisUsage &AU) const override;
 
 public:
   Scop &getCurScop() const {
@@ -56,8 +56,8 @@ public:
   }
 
 private:
-  virtual bool runOnRegion(Region *R, RGPassManager &RGM);
-  void print(raw_ostream &OS, const Module *) const;
+  bool runOnRegion(Region *R, RGPassManager &RGM) override;
+  void print(raw_ostream &OS, const Module *) const override;
 };
 
 } // End llvm namespace
index 1266446..fde674d 100644 (file)
@@ -940,7 +940,7 @@ public:
     return true;
   }
 
-  bool runOnScop(Scop &S) {
+  bool runOnScop(Scop &S) override {
     AI = &getAnalysis<IslAstInfo>();
 
     // Check if we created an isl_ast root node, otherwise exit.
@@ -977,9 +977,9 @@ public:
     return true;
   }
 
-  virtual void printScop(raw_ostream &, Scop &) const {}
+  void printScop(raw_ostream &, Scop &) const override {}
 
-  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+  void getAnalysisUsage(AnalysisUsage &AU) const override {
     AU.addRequired<DataLayoutPass>();
     AU.addRequired<DominatorTreeWrapperPass>();
     AU.addRequired<IslAstInfo>();
index 3cce5c5..699a3e1 100644 (file)
@@ -58,10 +58,10 @@ public:
   static char ID;
   explicit DeadCodeElim() : ScopPass(ID) {}
 
-  virtual bool runOnScop(Scop &S);
+  bool runOnScop(Scop &S) override;
 
-  void printScop(raw_ostream &OS, Scop &S) const;
-  void getAnalysisUsage(AnalysisUsage &AU) const;
+  void printScop(raw_ostream &OS, Scop &S) const override;
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
 
 private:
   /// @brief Return the set of live iterations.
index ca2189f..34593d9 100644 (file)
@@ -99,9 +99,9 @@ public:
 
   ~IslScheduleOptimizer() { isl_schedule_free(LastSchedule); }
 
-  virtual bool runOnScop(Scop &S);
-  void printScop(raw_ostream &OS, Scop &S) const;
-  void getAnalysisUsage(AnalysisUsage &AU) const;
+  bool runOnScop(Scop &S) override;
+  void printScop(raw_ostream &OS, Scop &S) const override;
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
 
 private:
   isl_schedule *LastSchedule;
@@ -204,7 +204,7 @@ private:
 
   using llvm::Pass::doFinalization;
 
-  virtual bool doFinalization() {
+  virtual bool doFinalization() override {
     isl_schedule_free(LastSchedule);
     LastSchedule = nullptr;
     return true;