Use hasAttr, not getAttr if we're just checking for presence.
llvm-svn: 246595
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 74a47bf..270d994 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1497,7 +1497,7 @@
// parse that and add it to the feature set.
StringRef TargetCPU = getTarget().getTargetOpts().CPU;
const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(TargetDecl);
- if (FD && FD->getAttr<TargetAttr>()) {
+ if (FD && FD->hasAttr<TargetAttr>()) {
llvm::StringMap<bool> FeatureMap;
const auto *TD = FD->getAttr<TargetAttr>();