From: Chandler Carruth Date: Thu, 10 Sep 2015 04:22:36 +0000 (+0000) Subject: [LPM] Simplify this code and fix a compile error for compilers that X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c7d2781ed7fa2e88cf83c72b39b5f5123b156ee;p=oota-llvm.git [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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247241 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp index a3e83fd5279..aec6874332a 100644 --- a/lib/IR/LegacyPassManager.cpp +++ b/lib/IR/LegacyPassManager.cpp @@ -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 &ImmPI = - PassInf->getInterfacesImplemented(); - for (const PassInfo *ImmPI : ImmPI) + for (const PassInfo *ImmPI : PassInf->getInterfacesImplemented()) ImmutablePassMap[ImmPI->getTypeInfo()] = P; }