[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 316724
diff --git a/llvm/lib/Transforms/ObjCARC/BlotMapVector.h b/llvm/lib/Transforms/ObjCARC/BlotMapVector.h
index 9c5cf6f..5518b49 100644
--- a/llvm/lib/Transforms/ObjCARC/BlotMapVector.h
+++ b/llvm/lib/Transforms/ObjCARC/BlotMapVector.h
@@ -1,4 +1,4 @@
-//===- BlotMapVector.h - A MapVector with the blot operation -*- C++ -*----===//
+//===- BlotMapVector.h - A MapVector with the blot operation ----*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,30 +7,29 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_LIB_TRANSFORMS_OBJCARC_BLOTMAPVECTOR_H
+#define LLVM_LIB_TRANSFORMS_OBJCARC_BLOTMAPVECTOR_H
+
 #include "llvm/ADT/DenseMap.h"
-#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <utility>
 #include <vector>
 
 namespace llvm {
+
 /// \brief An associative container with fast insertion-order (deterministic)
 /// iteration over its elements. Plus the special blot operation.
 template <class KeyT, class ValueT> class BlotMapVector {
   /// Map keys to indices in Vector.
-  typedef DenseMap<KeyT, size_t> MapTy;
+  using MapTy = DenseMap<KeyT, size_t>;
   MapTy Map;
 
-  typedef std::vector<std::pair<KeyT, ValueT>> VectorTy;
   /// Keys and values.
+  using VectorTy = std::vector<std::pair<KeyT, ValueT>>;
   VectorTy Vector;
 
 public:
-  typedef typename VectorTy::iterator iterator;
-  typedef typename VectorTy::const_iterator const_iterator;
-  iterator begin() { return Vector.begin(); }
-  iterator end() { return Vector.end(); }
-  const_iterator begin() const { return Vector.begin(); }
-  const_iterator end() const { return Vector.end(); }
-
 #ifdef EXPENSIVE_CHECKS
   ~BlotMapVector() {
     assert(Vector.size() >= Map.size()); // May differ due to blotting.
@@ -46,6 +45,14 @@
   }
 #endif
 
+  using iterator = typename VectorTy::iterator;
+  using const_iterator = typename VectorTy::const_iterator;
+
+  iterator begin() { return Vector.begin(); }
+  iterator end() { return Vector.end(); }
+  const_iterator begin() const { return Vector.begin(); }
+  const_iterator end() const { return Vector.end(); }
+
   ValueT &operator[](const KeyT &Arg) {
     std::pair<typename MapTy::iterator, bool> Pair =
         Map.insert(std::make_pair(Arg, size_t(0)));
@@ -105,4 +112,7 @@
     return Map.empty();
   }
 };
-} //
+
+} // end namespace llvm
+
+#endif // LLVM_LIB_TRANSFORMS_OBJCARC_BLOTMAPVECTOR_H