[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 308936
diff --git a/llvm/lib/Analysis/IntervalPartition.cpp b/llvm/lib/Analysis/IntervalPartition.cpp
index a4e56e0..c777d91 100644
--- a/llvm/lib/Analysis/IntervalPartition.cpp
+++ b/llvm/lib/Analysis/IntervalPartition.cpp
@@ -12,10 +12,17 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Analysis/IntervalPartition.h"
+#include "llvm/Analysis/Interval.h"
#include "llvm/Analysis/IntervalIterator.h"
+#include "llvm/Pass.h"
+#include <cassert>
+#include <utility>
+
using namespace llvm;
char IntervalPartition::ID = 0;
+
INITIALIZE_PASS(IntervalPartition, "intervals",
"Interval Partition Construction", true, true)
@@ -40,7 +47,6 @@
// addIntervalToPartition - Add an interval to the internal list of intervals,
// and then add mappings from all of the basic blocks in the interval to the
// interval itself (in the IntervalMap).
-//
void IntervalPartition::addIntervalToPartition(Interval *I) {
Intervals.push_back(I);
@@ -54,7 +60,6 @@
// the interval data structures. After interval generation is complete,
// run through all of the intervals and propagate successor info as
// predecessor info.
-//
void IntervalPartition::updatePredecessors(Interval *Int) {
BasicBlock *Header = Int->getHeaderNode();
for (BasicBlock *Successor : Int->Successors)
@@ -63,7 +68,6 @@
// IntervalPartition ctor - Build the first level interval partition for the
// specified function...
-//
bool IntervalPartition::runOnFunction(Function &F) {
// Pass false to intervals_begin because we take ownership of it's memory
function_interval_iterator I = intervals_begin(&F, false);
@@ -84,11 +88,9 @@
return false;
}
-
// IntervalPartition ctor - Build a reduced interval partition from an
// existing interval graph. This takes an additional boolean parameter to
// distinguish it from a copy constructor. Always pass in false for now.
-//
IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
: FunctionPass(ID) {
assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!");
@@ -110,4 +112,3 @@
for (unsigned i = 0, e = Intervals.size(); i != e; ++i)
updatePredecessors(Intervals[i]);
}
-