summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index c3fd54e7b22..5274b53ccc1 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -341,10 +341,15 @@ bool CodeGenFunction::checkBuiltinTargetFeatures(
// true, otherwise return false.
SmallVector<StringRef, 1> AttrFeatures;
StringRef(FeatureList).split(AttrFeatures, ",");
- for (const auto &Feature : AttrFeatures)
- if (FeatureMap[Feature])
- return true;
- return false;
+ return std::all_of(AttrFeatures.begin(), AttrFeatures.end(),
+ [&](StringRef &Feature) {
+ SmallVector<StringRef, 1> OrFeatures;
+ Feature.split(OrFeatures, "|");
+ return std::any_of(OrFeatures.begin(), OrFeatures.end(),
+ [&](StringRef &Feature) {
+ return FeatureMap[Feature];
+ });
+ });
}
RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
OpenPOWER on IntegriCloud