Use the Attributes::get method which takes an AttrVal value directly to simplify...
[oota-llvm.git] / lib / Transforms / Scalar / SimplifyLibCalls.cpp
index 0223d39ab3bc28cc0115df107b9b8bc325c0ea8c..d86c4cbc9f6d102b099cccd8bbb5ecfee5bee68e 100644 (file)
@@ -348,9 +348,8 @@ struct StrToOpt : public LibCallOptimization {
     if (isa<ConstantPointerNull>(EndPtr)) {
       // With a null EndPtr, this function won't capture the main argument.
       // It would be readonly too, except that it still may write to errno.
-      AttrBuilder B;
-      B.addAttribute(Attributes::NoCapture);
-      CI->addAttribute(1, Attributes::get(Callee->getContext(), B));
+      CI->addAttribute(1, Attributes::get(Callee->getContext(),
+                                          Attributes::NoCapture));
     }
 
     return 0;