From: Devang Patel Date: Fri, 8 Dec 2006 23:57:43 +0000 (+0000) Subject: Do not drop ImmutablePasses on the floor. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c9a6293af7b433146d8f7ecf8fa494b530af9376;p=oota-llvm.git Do not drop ImmutablePasses on the floor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32386 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 08249132228..688dfee1955 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -394,15 +394,16 @@ public: inline void addTopLevelPass(Pass *P) { - if (dynamic_cast (P)) { + if (ImmutablePass *IP = dynamic_cast (P)) { // P is a immutable pass then it will be managed by this // top level manager. Set up analysis resolver to connect them. AnalysisResolver_New *AR = new AnalysisResolver_New(*this); P->setResolver(AR); - } - - addPass(P); + addImmutablePass(IP); + } + else + addPass(P); } /// add - Add a pass to the queue of passes to run. This passes @@ -498,15 +499,16 @@ public: inline void addTopLevelPass(Pass *P) { - if (dynamic_cast (P)) { + if (ImmutablePass *IP = dynamic_cast (P)) { // P is a immutable pass and it will be managed by this // top level manager. Set up analysis resolver to connect them. AnalysisResolver_New *AR = new AnalysisResolver_New(*this); P->setResolver(AR); + addImmutablePass(IP); } - - addPass(P); + else + addPass(P); } private: