This is an archive of the discontinued LLVM Phabricator instance.

[Sema][SVE] Don't allow static or thread-local variables to have sizeless type
ClosedPublic

Authored by rsandifo-arm on Mar 6 2020, 4:30 AM.

Details

Summary

clang accepts a TU containing just:

__SVInt8_t x;

However, sizeless types are not allowed to have static or thread-local
storage duration and trying to code-generate the TU triggers an LLVM
fatal error:

Globals cannot contain scalable vectors
<vscale x 16 x i8>* @x
fatal error: error in backend: Broken module found, compilation aborted!

This patch adds an associated clang diagnostic.

Diff Detail

Event Timeline

rsandifo-arm created this revision.Mar 6 2020, 4:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2020, 4:30 AM
This revision is now accepted and ready to land.Mar 11 2020, 7:21 PM
This revision was automatically updated to reflect the committed changes.