diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 74a47bfc2b68..270d9941ec8a 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1497,7 +1497,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, // parse that and add it to the feature set. StringRef TargetCPU = getTarget().getTargetOpts().CPU; const FunctionDecl *FD = dyn_cast_or_null(TargetDecl); - if (FD && FD->getAttr()) { + if (FD && FD->hasAttr()) { llvm::StringMap FeatureMap; const auto *TD = FD->getAttr();