Use hasAttr, not getAttr if we're just checking for presence.

llvm-svn: 246595
This commit is contained in:
Eric Christopher 2015-09-01 22:03:56 +00:00
parent 699a9dd7c3
commit b57804a134
1 changed files with 1 additions and 1 deletions

View 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>();