diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:36:24 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:36:24 +0000 | 
| commit | 36c5ade2f4674b544039d78db4c466756cf142b0 (patch) | |
| tree | 3d3ed1e1987dbe6444294b1b4e249814b97b97a5 /lib/Sema/DeclSpec.cpp | |
| parent | 51ece4aae5857052d224ce52277924c74685714e (diff) | |
Notes
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
| -rw-r--r-- | lib/Sema/DeclSpec.cpp | 22 | 
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp index ea3872f42700a..4adbb2b6af2a5 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -987,10 +987,11 @@ void DeclSpec::Finish(DiagnosticsEngine &D, Preprocessor &PP, const PrintingPoli          Diag(D, TSWLoc, diag::err_invalid_vector_bool_decl_spec)            << getSpecifierName((TSW)TypeSpecWidth); -      // vector bool long long requires VSX support. +      // vector bool long long requires VSX support or ZVector.        if ((TypeSpecWidth == TSW_longlong) &&            (!PP.getTargetInfo().hasFeature("vsx")) && -          (!PP.getTargetInfo().hasFeature("power8-vector"))) +          (!PP.getTargetInfo().hasFeature("power8-vector")) && +          !PP.getLangOpts().ZVector)          Diag(D, TSTLoc, diag::err_invalid_vector_long_long_decl_spec);        // Elements of vector bool are interpreted as unsigned. (PIM 2.1) @@ -999,14 +1000,23 @@ void DeclSpec::Finish(DiagnosticsEngine &D, Preprocessor &PP, const PrintingPoli          TypeSpecSign = TSS_unsigned;      } else if (TypeSpecType == TST_double) {        // vector long double and vector long long double are never allowed. -      // vector double is OK for Power7 and later. +      // vector double is OK for Power7 and later, and ZVector.        if (TypeSpecWidth == TSW_long || TypeSpecWidth == TSW_longlong)          Diag(D, TSWLoc, diag::err_invalid_vector_long_double_decl_spec); -      else if (!PP.getTargetInfo().hasFeature("vsx")) +      else if (!PP.getTargetInfo().hasFeature("vsx") && +               !PP.getLangOpts().ZVector)          Diag(D, TSTLoc, diag::err_invalid_vector_double_decl_spec); +    } else if (TypeSpecType == TST_float) { +      // vector float is unsupported for ZVector. +      if (PP.getLangOpts().ZVector) +        Diag(D, TSTLoc, diag::err_invalid_vector_float_decl_spec);      } else if (TypeSpecWidth == TSW_long) { -      Diag(D, TSWLoc, diag::warn_vector_long_decl_spec_combination) -        << getSpecifierName((TST)TypeSpecType, Policy); +      // vector long is unsupported for ZVector and deprecated for AltiVec. +      if (PP.getLangOpts().ZVector) +        Diag(D, TSWLoc, diag::err_invalid_vector_long_decl_spec); +      else +        Diag(D, TSWLoc, diag::warn_vector_long_decl_spec_combination) +          << getSpecifierName((TST)TypeSpecType, Policy);      }      if (TypeAltiVecPixel) {  | 
