mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 04:06:20 +00:00
[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.
This commit is contained in:
parent
0854867798
commit
0213adde21
@ -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>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user