[PATCH] D89443: [PowerPC][AIX] Make `__vector [un]signed long` an error

2020-10-18 Thread Hubert Tong via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
hubert.reinterpretcast marked an inline comment as done.
Closed by commit rG126094485ab9: [PowerPC][AIX] Make `__vector [un]signed long` 
an error (authored by hubert.reinterpretcast).

Changed prior to commit:
  https://reviews.llvm.org/D89443?vs=298287=298878#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89443/new/

https://reviews.llvm.org/D89443

Files:
  clang/lib/Sema/DeclSpec.cpp
  clang/test/Parser/altivec.c
  clang/test/Parser/cxx-altivec.cpp

Index: clang/test/Parser/cxx-altivec.cpp
===
--- clang/test/Parser/cxx-altivec.cpp
+++ clang/test/Parser/cxx-altivec.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix -std=c++11 %s
 #include 
 
 __vector char vv_c;
@@ -55,19 +57,33 @@
 
 vector int v = (vector int)(-1);
 
+// These should have errors on AIX and warnings otherwise.
+__vector long vv_l; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long vv_sl; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long vv_ul;   // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector long int vv_li;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long int vv_sli;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long int vv_uli;  // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long v_l;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long v_sl;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long v_ul;  // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long int v_li;   // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long int v_sli;   // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long int v_uli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+
 // These should have warnings.
-__vector long vv_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector signed long vv_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector unsigned long vv_ul;   // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector long int vv_li;// expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector signed long int vv_sli;// expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector unsigned long int vv_uli;  // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-vector long v_l;// expected-warning {{Use of 'long' with '__vector' 

[PATCH] D89443: [PowerPC][AIX] Make `__vector [un]signed long` an error

2020-10-16 Thread Zarko Todorovski via Phabricator via cfe-commits
ZarkoCA accepted this revision.
ZarkoCA added a comment.
This revision is now accepted and ready to land.

LGTM




Comment at: clang/lib/Sema/DeclSpec.cpp:1200
+  // It has also been historically deprecated on AIX (as an alias for
+  // "vector int" in both 32-bit and 64-bit modes) and was made unsupported
+  // in the Clang-based XL compiler since the deprecated type has a number

minor nit, prefer to divide the comment in 2 sentences.  


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89443/new/

https://reviews.llvm.org/D89443

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D89443: [PowerPC][AIX] Make `__vector [un]signed long` an error

2020-10-14 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast created this revision.
hubert.reinterpretcast added reviewers: nemanjai, ZarkoCA, cebowleratibm.
Herald added a subscriber: shchenz.
Herald added a project: clang.
hubert.reinterpretcast requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89443

Files:
  clang/lib/Sema/DeclSpec.cpp
  clang/test/Parser/altivec.c
  clang/test/Parser/cxx-altivec.cpp

Index: clang/test/Parser/cxx-altivec.cpp
===
--- clang/test/Parser/cxx-altivec.cpp
+++ clang/test/Parser/cxx-altivec.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -fsyntax-only -verify=expected,nonaix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix -std=c++11 %s
+// RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec -fsyntax-only -verify=expected,aix -std=c++11 %s
 #include 
 
 __vector char vv_c;
@@ -55,19 +57,33 @@
 
 vector int v = (vector int)(-1);
 
+// These should have errors on AIX and warnings otherwise.
+__vector long vv_l; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long vv_sl; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long vv_ul;   // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector long int vv_li;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector signed long int vv_sli;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+__vector unsigned long int vv_uli;  // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long v_l;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long v_sl;// nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long v_ul;  // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector long int v_li;   // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector signed long int v_sli;   // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+vector unsigned long int v_uli; // nonaix-warning {{Use of 'long' with '__vector' is deprecated}}
+// aix-error@-1 {{cannot use 'long' with '__vector'}}
+
 // These should have warnings.
-__vector long vv_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector signed long vv_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
-__vector unsigned long vv_ul;   // expected-warning {{Use of 'long' with