diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 6ed9d0e8c48e..4ea421a57d92 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2230,7 +2230,7 @@ void CodeGenModule::ConstructAttributeList(StringRef Name, } if (TargetDecl->hasAttr()) { FuncAttrs.addAttribute(llvm::Attribute::StrandPure); - FuncAttrs.addAttribute(llvm::Attribute::ReadOnly); + FuncAttrs.addMemoryAttr(llvm::MemoryEffects::readOnly()); FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); } if (TargetDecl->hasAttr()) {