// We know that GetCPUAndFeaturesAttributes will always have the
// newest set, since it has the newest possible FunctionDecl, so the
// new ones should replace the old.
- F->removeFnAttr("target-cpu");
- F->removeFnAttr("target-features");
- F->removeFnAttr("tune-cpu");
+ llvm::AttrBuilder RemoveAttrs;
+ RemoveAttrs.addAttribute("target-cpu");
+ RemoveAttrs.addAttribute("target-features");
+ RemoveAttrs.addAttribute("tune-cpu");
+ F->removeAttributes(llvm::AttributeList::FunctionIndex, RemoveAttrs);
F->addAttributes(llvm::AttributeList::FunctionIndex, Attrs);
}
}