diff options
| author | Eric Christopher <echristo@gmail.com> | 2015-10-27 06:11:03 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2015-10-27 06:11:03 +0000 |
| commit | 99af5b2ea7d25f44edeb9182b926943b4666f713 (patch) | |
| tree | 37fefa512216d2c8c6cc10809886e1008407867f /clang/lib/CodeGen/CGBuiltin.cpp | |
| parent | 9f690bd80bb67d483df2b9e15261e548f8b3a474 (diff) | |
| download | bcm5719-llvm-99af5b2ea7d25f44edeb9182b926943b4666f713.tar.gz bcm5719-llvm-99af5b2ea7d25f44edeb9182b926943b4666f713.zip | |
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
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 13 |
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, |

