[PATCH] Support base vector types of __attribute__((mode))

Aaron Ballman aaron.ballman at gmail.com
Thu May 28 07:50:15 PDT 2015


CC'ing in Chris, who had expressed concerns in the original PR.

On Wed, May 27, 2015 at 12:51 PM, Alexey Frolov
<alexfrolov1878 at yandex.ru> wrote:
>> Aaron Ballman wrote:
>
>> "I am unfamiliar with __attribute__((mode)); is there documentation that supports this assertion, or popular code in the wild that is relying on it? GCC's docs are very spartan on the >topic, and there was an (unanswered) question in the PR regarding why we would want to support this."
>
> __attribute__((mode)) is a GCC extension. It is already supported in Clang, but only partially as the current implementation does not cover cases with base vector types.
> I tend to claim this issue (described in PR17453) a missing feature/incomplete implementation as GCC compiler does support base vector types.
> The community already accepted similar patches for this attribute (issues described in PR16752, PR8703 and PR3691, for example). I hope to think this patch is desirable too.

I am familiar with that. What I am unfamiliar with is documentation
about GCC's implementation so we can be sure we're matching their
semantics, or popular source code relying on that functionality. I'm
not opposed to the patch, just want to make sure it's worth the burden
of supporting it.

~Aaron

>> Aaron Ballman wrote: "The diagnostic you added does not accept any arguments."
>
>>
>
>>   +    if (ComplexMode) {
>
>>   +      S.Diag(Attr.getLoc(), diag::err_complex_mode_vector_type) << Name;
>
>>
>
>> Aaron Ballman wrote: "This diagnostic also does not accept any arguments."
>
>>
>
>>   +  if (NewTy.isNull()) {
>
>>   +    S.Diag(Attr.getLoc(), diag::err_mode_wrong_type) << Name;
>
>
> I removed arguments for the two mentioned diagnostics and updated the patch.
>
>
> REPOSITORY
>   rL LLVM
>
> http://reviews.llvm.org/D10058
>
> Files:
>   include/clang/Basic/DiagnosticSemaKinds.td
>   lib/Sema/SemaDeclAttr.cpp
>   test/CodeGen/attr-mode-vector-types.c
>   test/Sema/attr-mode-vector-types.c
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/




More information about the cfe-commits mailing list