diff options
author | Erich Keane <erich.keane@intel.com> | 2019-11-18 13:38:56 -0800 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2019-11-18 13:43:52 -0800 |
commit | 0213adde218530bc31e5c4e50b49704c6bb2f2e9 (patch) | |
tree | c88004261b31d31e33bcc1a1d7b1de73175fe830 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 085486779890e394dd42447c7c5b0fb36a79ea2b (diff) | |
download | bcm5719-llvm-0213adde218530bc31e5c4e50b49704c6bb2f2e9.tar.gz bcm5719-llvm-0213adde218530bc31e5c4e50b49704c6bb2f2e9.zip |
[NFC] Fix 'target' condition in checkTargetFeatures
checkTargetFeatures was incorrectly checking for cpu_specific instead of
just 'target'. While this function was never called in that situation,
it seemed correct to fix the condition. Additionally, multiversion
functions can never be always_inline, but if any function accidentially
ended up here we shouldn't diagnose.
Note that the adding of target-features to the list is unnecessary since
the getFunctionFeatureMap actually considers attribute target,
however adding it results in significantly better error messages by
putting the 'target' features first (and thus first to fail).
Otherwise, the error message would be the first feature 'implied' by the
target attribute, and not necessarily the feature listed in the
attribute itself.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 6f2bd8c16b3..68b599e88bc 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2223,8 +2223,8 @@ void CodeGenFunction::checkTargetFeatures(SourceLocation Loc, << TargetDecl->getDeclName() << CGM.getContext().BuiltinInfo.getRequiredFeatures(BuiltinID); - } else if (TargetDecl->hasAttr<TargetAttr>() || - TargetDecl->hasAttr<CPUSpecificAttr>()) { + } else if (!TargetDecl->isMultiVersion() && + TargetDecl->hasAttr<TargetAttr>()) { // Get the required features for the callee. const TargetAttr *TD = TargetDecl->getAttr<TargetAttr>(); |