[LPM] Simplify this code and fix a compile error for compilers that
don't correctly implement the scoping rules of C++11 range based for
loops. This kind of aliasing isn't a good idea anyways (and wasn't
really intended).

llvm-svn: 247241
GitOrigin-RevId: 87275186d1eb1fde38e133f2852317d817907bc5
diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp
index a3e83fd..aec6874 100644
--- a/lib/IR/LegacyPassManager.cpp
+++ b/lib/IR/LegacyPassManager.cpp
@@ -729,9 +729,7 @@
   // fast lookup.
   const PassInfo *PassInf = findAnalysisPassInfo(AID);
   assert(PassInf && "Expected all immutable passes to be initialized");
-  const std::vector<const PassInfo*> &ImmPI =
-    PassInf->getInterfacesImplemented();
-  for (const PassInfo *ImmPI : ImmPI)
+  for (const PassInfo *ImmPI : PassInf->getInterfacesImplemented())
     ImmutablePassMap[ImmPI->getTypeInfo()] = P;
 }