From 99af5b2ea7d25f44edeb9182b926943b4666f713 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 27 Oct 2015 06:11:03 +0000 Subject: Handle target builtin options that are all required rather than only one of a group of possibilities. This changes the syntax in the builtin files to represent: , as the and operator | as the or operator The former syntax matches how the backend tablegen files represent multiple subtarget features being required. Updated the builtin and intrinsic headers accordingly for the new syntax. llvm-svn: 251388 --- clang/lib/CodeGen/CGBuiltin.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGBuiltin.cpp') 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 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 OrFeatures; + Feature.split(OrFeatures, "|"); + return std::any_of(OrFeatures.begin(), OrFeatures.end(), + [&](StringRef &Feature) { + return FeatureMap[Feature]; + }); + }); } RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, -- cgit v1.2.3