Attributes Rewrite
[oota-llvm.git] / lib / Transforms / IPO / PruneEH.cpp
index 8ebf6ee1dd0c6186bbc7199ce54b0fe74baa6bee..b5252aac847067338b7a792b5259b9b487b34c24 100644 (file)
@@ -140,13 +140,15 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC) {
       Attributes::Builder NewAttributes;
 
       if (!SCCMightUnwind)
-        NewAttributes.addNoUnwindAttr();
+        NewAttributes.addAttribute(Attributes::NoUnwind);
       if (!SCCMightReturn)
-        NewAttributes.addNoReturnAttr();
+        NewAttributes.addAttribute(Attributes::NoReturn);
 
       Function *F = (*I)->getFunction();
       const AttrListPtr &PAL = F->getAttributes();
-      const AttrListPtr &NPAL = PAL.addAttr(~0, Attributes::get(NewAttributes));
+      const AttrListPtr &NPAL = PAL.addAttr(F->getContext(), ~0,
+                                            Attributes::get(F->getContext(),
+                                                            NewAttributes));
       if (PAL != NPAL) {
         MadeChange = true;
         F->setAttributes(NPAL);