]> granicus.if.org Git - clang/commitdiff
Use hasAttr, not getAttr if we're just checking for presence.
authorEric Christopher <echristo@gmail.com>
Tue, 1 Sep 2015 22:03:56 +0000 (22:03 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 1 Sep 2015 22:03:56 +0000 (22:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246595 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp

index 74a47bfc2b68eecc5188dab6425866129620169c..270d9941ec8a0837eeb4cb5184302f22ab94588e 100644 (file)
@@ -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<FunctionDecl>(TargetDecl);
-    if (FD && FD->getAttr<TargetAttr>()) {
+    if (FD && FD->hasAttr<TargetAttr>()) {
       llvm::StringMap<bool> FeatureMap;
       const auto *TD = FD->getAttr<TargetAttr>();