summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-11-16 18:29:59 +0000
committerEric Christopher <echristo@gmail.com>2015-11-16 18:29:59 +0000
commitb7bbc5331470b7dc0fb8d5c0154f8f39372583f1 (patch)
tree7a98abd23b767fa8c4ec1d31a73b81ef6b4f10df /clang/lib/CodeGen/CodeGenFunction.cpp
parent2de9f545aaacd81846d75c3123b06b27e177e4e5 (diff)
downloadbcm5719-llvm-b7bbc5331470b7dc0fb8d5c0154f8f39372583f1.tar.gz
bcm5719-llvm-b7bbc5331470b7dc0fb8d5c0154f8f39372583f1.zip
When producing error messages for always_inline functions with the
target attribute, don't include "negative" subtarget features in the list of required features. Builtins are positive by default so don't need this change, but we pull the default list of features from the command line and so need to make sure that we only include features that are turned on for code generation in our error. llvm-svn: 253242
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index a425c3e229a..4c1d6af7530 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1917,8 +1917,11 @@ void CodeGenFunction::checkTargetFeatures(const CallExpr *E,
SmallVector<StringRef, 1> ReqFeatures;
llvm::StringMap<bool> CalleeFeatureMap;
CGM.getFunctionFeatureMap(CalleeFeatureMap, TargetDecl);
- for (const auto &F : CalleeFeatureMap)
- ReqFeatures.push_back(F.getKey());
+ for (const auto &F : CalleeFeatureMap) {
+ // Only positive features are "required".
+ if (F.getValue())
+ ReqFeatures.push_back(F.getKey());
+ }
if (!hasRequiredFeatures(ReqFeatures, CGM, FD, MissingFeature))
CGM.getDiags().Report(E->getLocStart(), diag::err_function_needs_feature)
<< FD->getDeclName() << TargetDecl->getDeclName() << MissingFeature;
OpenPOWER on IntegriCloud