llvm.org GIT mirror llvm / 617fddf
Remove interfaces implemented by dead pass from the list of available passes. Patch By Matthijs Kooijman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57202 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
2 changed file(s) with 28 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
778778 if (TheTimeInfo) TheTimeInfo->passStarted(*I);
779779 (*I)->releaseMemory();
780780 if (TheTimeInfo) TheTimeInfo->passEnded(*I);
781
782 std::map::iterator Pos =
783 AvailableAnalysis.find((*I)->getPassInfo());
784
785 // It is possible that pass is already removed from the AvailableAnalysis
786 if (Pos != AvailableAnalysis.end())
787 AvailableAnalysis.erase(Pos);
781 if (const PassInfo *PI = (*I)->getPassInfo()) {
782 std::map::iterator Pos =
783 AvailableAnalysis.find(PI);
784
785 // It is possible that pass is already removed from the AvailableAnalysis
786 if (Pos != AvailableAnalysis.end())
787 AvailableAnalysis.erase(Pos);
788
789 // Remove all interfaces this pass implements, for which it is also
790 // listed as the available implementation.
791 const std::vector &II = PI->getInterfacesImplemented();
792 for (unsigned i = 0, e = II.size(); i != e; ++i) {
793 Pos = AvailableAnalysis.find(II[i]);
794 if (Pos != AvailableAnalysis.end() && Pos->second == *I)
795 AvailableAnalysis.erase(Pos);
796 }
797 }
788798 }
789799 }
790800
0 ; RUN: llvm-as < %s | opt -inline -internalize -disable-output
1 define void @foo() nounwind {
2 ret void
3 }
4
5 define void @main(...) nounwind {
6 call void @foo()
7 ret void
8 }
9
10