aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2020-10-18 10:30:14 -0400
committerHubert Tong <hubert.reinterpretcast@gmail.com>2020-10-18 12:39:16 -0400
commit126094485ab99dac3e6df9c201124d48a1d798ce (patch)
tree52e9a526416dbd1e5c08a6f6013dfe258736be29 /clang/lib/Sema/DeclSpec.cpp
parent2980ce98be117a756ec5ad485273fd5400049683 (diff)
downloadllvm-126094485ab99dac3e6df9c201124d48a1d798ce.zip
llvm-126094485ab99dac3e6df9c201124d48a1d798ce.tar.gz
llvm-126094485ab99dac3e6df9c201124d48a1d798ce.tar.bz2
[PowerPC][AIX] Make `__vector [un]signed long` an error
The semantics associated with `__vector [un]signed long` are neither consistently specified nor consistently implemented. The IBM XL compilers on AIX traditionally treated these as deprecated aliases for the corresponding `__vector int` type in both 32-bit and 64-bit modes. The newer, Clang-based, IBM XL compilers on AIX make usage of the previously deprecated types an error. This is also consistent with IBM XL C/C++ for Linux on Power (on little endian distributions). In line with the above, this patch upgrades (on AIX) the deprecation of `__vector long` to become removal. Reviewed By: ZarkoCA Differential Revision: https://reviews.llvm.org/D89443
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index a3f770b..dc37474 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -1196,7 +1196,13 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
S.Diag(TSTLoc, diag::err_invalid_vector_float_decl_spec);
} else if (TypeSpecWidth == TSW_long) {
// vector long is unsupported for ZVector and deprecated for AltiVec.
- if (S.getLangOpts().ZVector)
+ // It has also been historically deprecated on AIX (as an alias for
+ // "vector int" in both 32-bit and 64-bit modes). It was then made
+ // unsupported in the Clang-based XL compiler since the deprecated type
+ // has a number of conflicting semantics and continuing to support it
+ // is a disservice to users.
+ if (S.getLangOpts().ZVector ||
+ S.Context.getTargetInfo().getTriple().isOSAIX())
S.Diag(TSWRange.getBegin(), diag::err_invalid_vector_long_decl_spec);
else
S.Diag(TSWRange.getBegin(),