diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 65e5e27a..77a5079 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1829,9 +1829,11 @@ void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, // 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); } } |