Make this pass return that it made a change if
authorDuncan Sands <baldrick@free.fr>
Fri, 5 Sep 2008 09:08:37 +0000 (09:08 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 5 Sep 2008 09:08:37 +0000 (09:08 +0000)
it modifies a functions attributes.

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

lib/Transforms/IPO/PruneEH.cpp

index 5e50e20af4db21f6ab360eafe904cb7445fa6a06..8fb904b1ea51257ab1b9c834fac63683ac9d414e 100644 (file)
@@ -133,7 +133,11 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
         NewAttributes |= ParamAttr::NoReturn;
 
       const PAListPtr &PAL = SCC[i]->getFunction()->getParamAttrs();
-      SCC[i]->getFunction()->setParamAttrs(PAL.addAttr(0, NewAttributes));
+      const PAListPtr &NPAL = PAL.addAttr(0, NewAttributes);
+      if (PAL != NPAL) {
+        MadeChange = true;
+        SCC[i]->getFunction()->setParamAttrs(NPAL);
+      }
     }
 
   for (unsigned i = 0, e = SCC.size(); i != e; ++i) {