Page MenuHomePhabricator

[Sema][SVE] Allow ?: to select between SVE types in C
ClosedPublic

Authored by rsandifo-arm on Mar 24 2020, 4:53 AM.

Details

Summary

When compiling C, a ?: between two values of the same SVE type
currently gives an error such as:

incompatible operand types ('svint8_t' (aka '__SVInt8_t') and 'svint8_t')

It's supposed to be valid to select between (cv-qualified versions of)
the same SVE type, so this patch adds that case.

These expressions already work for C++ and are tested by
SemaCXX/sizeless-1.cpp.

Diff Detail

Event Timeline

rsandifo-arm created this revision.Mar 24 2020, 4:53 AM
Herald added a project: Restricted Project. · View Herald Transcript

Do we want to allow stuff like x ? (svint8_t)0 : (signed char)0

Do we want to allow stuff like x ? (svint8_t)0 : (signed char)0

(svint8_t)0 is invalid as thing stand. The intention is for the types to be opaque and only used via intrinsics, rather than be vector-like.

This revision is now accepted and ready to land.Mar 24 2020, 8:25 PM
This revision was automatically updated to reflect the committed changes.