[clang] [Clang] Treat `ext_vector_type` as a regular type attribute (PR #130177)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 6 18:16:35 PST 2025


================
@@ -1721,17 +1721,10 @@ def EnableIf : InheritableAttr {
   let Documentation = [EnableIfDocs];
 }
 
-def ExtVectorType : Attr {
-  // This is an OpenCL-related attribute and does not receive a [[]] spelling.
-  let Spellings = [GNU<"ext_vector_type">];
-  // FIXME: This subject list is wrong; this is a type attribute.
-  let Subjects = SubjectList<[TypedefName], ErrorDiag>;
+def ExtVectorType : TypeAttr {
+  let Spellings = [RegularKeyword<"__vector_type">, GNU<"ext_vector_type">];
----------------
erichkeane wrote:

I don't like the keyword here, particuarly when it doesn't match the attribute. For better or worse, these types are a wart from the GNU variants of these, and we should stick it that way.  As a keyword it isn't clear whether this should be treated as a qualifier or specifier, and this patch doesn't answer that at all.

Additionally, the `Clang` spelling was the right one, this is a clang attribute, we should spell it like 'clang.

https://github.com/llvm/llvm-project/pull/130177


More information about the cfe-commits mailing list