// 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;