Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
[oota-llvm.git] / include / llvm / Analysis / IntervalPartition.h
index e724681fa4935682d6a65d6838955f7bec7d86fd..274be2bdcfa9c20815066e7124d50720d736c995 100644 (file)
@@ -20,8 +20,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_INTERVAL_PARTITION_H
-#define LLVM_INTERVAL_PARTITION_H
+#ifndef LLVM_ANALYSIS_INTERVALPARTITION_H
+#define LLVM_ANALYSIS_INTERVALPARTITION_H
 
 #include "llvm/Analysis/Interval.h"
 #include "llvm/Pass.h"
@@ -33,8 +33,8 @@ namespace llvm {
 //
 // IntervalPartition - This class builds and holds an "interval partition" for
 // a function.  This partition divides the control flow graph into a set of
-// maximal intervals, as defined with the properties above.  Intuitively, a
-// BasicBlock is a (possibly nonexistent) loop with a "tail" of non looping
+// maximal intervals, as defined with the properties above.  Intuitively, an
+// interval is a (possibly nonexistent) loop with a "tail" of non-looping
 // nodes following it.
 //
 class IntervalPartition : public FunctionPass {
@@ -48,10 +48,12 @@ class IntervalPartition : public FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {}
+  IntervalPartition() : FunctionPass(ID), RootInterval(nullptr) {
+    initializeIntervalPartitionPass(*PassRegistry::getPassRegistry());
+  }
 
   // run - Calculate the interval partition for this function
-  virtual bool runOnFunction(Function &F);
+  bool runOnFunction(Function &F) override;
 
   // IntervalPartition ctor - Build a reduced interval partition from an
   // existing interval graph.  This takes an additional boolean parameter to
@@ -60,10 +62,7 @@ public:
   IntervalPartition(IntervalPartition &I, bool);
 
   // print - Show contents in human readable format...
-  virtual void print(std::ostream &O, const Module* = 0) const;
-  void print(std::ostream *O, const Module* M = 0) const {
-    if (O) print(*O, M);
-  }
+  void print(raw_ostream &O, const Module* = nullptr) const override;
 
   // getRootInterval() - Return the root interval that contains the starting
   // block of the function.
@@ -78,11 +77,11 @@ public:
   // getBlockInterval - Return the interval that a basic block exists in.
   inline Interval *getBlockInterval(BasicBlock *BB) {
     IntervalMapTy::iterator I = IntervalMap.find(BB);
-    return I != IntervalMap.end() ? I->second : 0;
+    return I != IntervalMap.end() ? I->second : nullptr;
   }
 
   // getAnalysisUsage - Implement the Pass API
-  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+  void getAnalysisUsage(AnalysisUsage &AU) const override {
     AU.setPreservesAll();
   }
 
@@ -90,7 +89,7 @@ public:
   const std::vector<Interval*> &getIntervals() const { return Intervals; }
 
   // releaseMemory - Reset state back to before function was analyzed
-  void releaseMemory();
+  void releaseMemory() override;
 
 private:
   // addIntervalToPartition - Add an interval to the internal list of intervals,