Use find instead of operator[] to test whether an element is in a std::map.

This fixes a bug that caused -debug-pass=Details to abort.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74654 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-07-01 23:12:33 +00:00
parent aa3943bf63
commit 82c32c4272

View File

@ -278,8 +278,10 @@ public:
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
ModulePass *MP = getContainedPass(Index); ModulePass *MP = getContainedPass(Index);
MP->dumpPassStructure(Offset + 1); MP->dumpPassStructure(Offset + 1);
if (FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP]) std::map<Pass *, FunctionPassManagerImpl *>::const_iterator I =
FPP->dumpPassStructure(Offset + 2); OnTheFlyManagers.find(MP);
if (I != OnTheFlyManagers.end())
I->second->dumpPassStructure(Offset + 2);
dumpLastUses(MP, Offset+1); dumpLastUses(MP, Offset+1);
} }
} }