[LPM] Simplify this code and fix a compile error for compilers that
authorChandler Carruth <chandlerc@gmail.com>
Thu, 10 Sep 2015 04:22:36 +0000 (04:22 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 10 Sep 2015 04:22:36 +0000 (04:22 +0000)
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247241 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/LegacyPassManager.cpp

index a3e83fd52798006f7ea0febb3e65d2a006400437..aec6874332ac8d7d6ea64437b7c947aa204853e0 100644 (file)
@@ -729,9 +729,7 @@ void PMTopLevelManager::addImmutablePass(ImmutablePass *P) {
   // 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;
 }