[cfe-dev] Modules requires, silent error issues

Sean Silva chisophugis at gmail.com
Fri May 22 14:10:05 PDT 2015


On Fri, May 22, 2015 at 7:36 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com>
wrote:

>
> On May 20, 2015, at 5:47 PM, Thompson, John <
> John_Thompson at playstation.sony.com> wrote:
>
> The module.modulemap has the two module entries:
>
>     explicit module sse4_1 {
>       requires sse41
>       export ssse3
>       header "smmintrin.h"
>     }
>
>     explicit module sse4_2 {
>       requires sse42
>       export sse4_1
>       header "nmmintrin.h"
>     }
>
> However, “sse41” and “sse42” in the requires don’t match the “sse4.1” and
> “sse4.2” target features.  This leads to error messages like:
>
> 4.cpp:5:12: error: call to '_mm_blendv_ps' is ambiguous
>     return _mm_blendv_ps(x,y,z);
>            ^~~~~~~~~~~~~
> ...\lib\clang\include\smmintrin.h:103:1: note: candidate function
> _mm_blendv_ps (__m128 __V1, __m128 __V2, __m128 __M)
> ^
> ...\lib\clang\include\smmintrin.h:103:1: note: candidate function
> _mm_blendv_ps (__m128 __V1, __m128 __V2, __m128 __M)
> ^
> 1 error generated.
>
> Because the ‘.’ makes the requires name an invalid identifier, either the
> feature name needs to change, or there needs to be some kinds of mapping or
> substitution done.  For example, I understand changing the feature name
> might be problematic, so changing the module map to use “sse4_1” and have
> clang replace the ‘_’ with ‘.’ before the feature check, or just map the
> problematic names, or decouple the “requires” names from the features
> names, are some possible options.  What do you think?
>
> But also, this raises another issue.  The reason I get the error is
> because the compiler silently failed to match the requires argument, but
> went ahead and processed the header textually or something, leading to the
> confusing error.  Could we improve the error detection here?  Are there
> other situations where a silent failure is problematic?
>
>
> The silent failure is problematic in general and we should fix this, could
> you file a bugzilla report to track this ?
>


I think this is PR23614.

-- Sean Silva


>
>
> Perhaps make the hasFeature return a three-state value with one that will
> indicate invalid feature name?
>
> Thanks.
>
> -John
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150522/c80ecac8/attachment.html>


More information about the cfe-dev mailing list