Fix filename in file header.
[oota-llvm.git] / lib / Transforms / IPO / GlobalOpt.cpp
index a1b976577a74e8366295df6b8652cb623b222679..6468ff3276ed82acb46e4ded35701d0b09eae4f4 100644 (file)
@@ -2061,8 +2061,8 @@ static void ChangeCalleesToFastCall(Function *F) {
   }
 }
 
-static AttrListPtr StripNest(const AttrListPtr &Attrs) {
-  Attributes::Builder B;
+static AttrListPtr StripNest(LLVMContext &C, const AttrListPtr &Attrs) {
+  AttrBuilder B;
   B.addAttribute(Attributes::Nest);
 
   for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
@@ -2070,19 +2070,19 @@ static AttrListPtr StripNest(const AttrListPtr &Attrs) {
       continue;
 
     // There can be only one.
-    return Attrs.removeAttr(Attrs.getSlot(i).Index, Attributes::get(B));
+    return Attrs.removeAttr(C, Attrs.getSlot(i).Index, Attributes::get(C, B));
   }
 
   return Attrs;
 }
 
 static void RemoveNestAttribute(Function *F) {
-  F->setAttributes(StripNest(F->getAttributes()));
+  F->setAttributes(StripNest(F->getContext(), F->getAttributes()));
   for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E;++UI){
     if (isa<BlockAddress>(*UI))
       continue;
     CallSite User(cast<Instruction>(*UI));
-    User.setAttributes(StripNest(User.getAttributes()));
+    User.setAttributes(StripNest(F->getContext(), User.getAttributes()));
   }
 }