summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-08-25 00:59:11 +0000
committerEric Christopher <echristo@gmail.com>2015-08-25 00:59:11 +0000
commit02c33354f05417cb912bdd83fc0cf3f57e741880 (patch)
treee5efea8ba527f353c20ea7b997752c36fd99012d /clang/lib/Basic/Targets.cpp
parent7ab76f2d71a9138a5ea41ceafc7a675e0da8eb3b (diff)
downloadbcm5719-llvm-02c33354f05417cb912bdd83fc0cf3f57e741880.tar.gz
bcm5719-llvm-02c33354f05417cb912bdd83fc0cf3f57e741880.zip
Reimplement the PPC explicit option checking to be a bit more obvious
that we're looking for conflicting options and give an explanation. llvm-svn: 245914
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index ae300214ecf..b78e2817f0e 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -1070,14 +1070,25 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
// TODO: Finish this list and add an assert that we've handled them
// all.
}
- if (!HasVSX && (HasP8Vector || HasDirectMove)) {
- if (HasP8Vector)
- Diags.Report(diag::err_opt_not_valid_with_opt) << "-mpower8-vector" <<
- "-mno-vsx";
- else if (HasDirectMove)
- Diags.Report(diag::err_opt_not_valid_with_opt) << "-mdirect-move" <<
- "-mno-vsx";
- return false;
+
+ // Handle explicit options being passed to the compiler here: if we've
+ // explicitly turned off vsx and turned on power8-vector or direct-move then
+ // go ahead and error since the customer has expressed a somewhat incompatible
+ // set of options.
+ if (std::find(Features.begin(), Features.end(), "-vsx") != Features.end()) {
+ if (std::find(Features.begin(), Features.end(), "+power8-vector") !=
+ Features.end()) {
+ Diags.Report(diag::err_opt_not_valid_with_opt) << "-mpower8-vector"
+ << "-mno-vsx";
+ return false;
+ }
+
+ if (std::find(Features.begin(), Features.end(), "+direct-move") !=
+ Features.end()) {
+ Diags.Report(diag::err_opt_not_valid_with_opt) << "-mdirect-move"
+ << "-mno-vsx";
+ return false;
+ }
}
return true;
OpenPOWER on IntegriCloud