[PATCH] D75737: [Sema][SVE] Don't allow fields to have sizeless type

Richard Sandiford via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 6 04:57:40 PST 2020


rsandifo-arm created this revision.
rsandifo-arm added reviewers: sdesmalen, efriedma, rovka, rjmccall.
Herald added subscribers: cfe-commits, psnobl, rkruppe, tschuett.
Herald added a reviewer: rengolin.
Herald added a project: clang.
rsandifo-arm added a parent revision: D75736: [Sema][SVE] Don't allow static or thread-local variables to have sizeless type.
rsandifo-arm added a child revision: D75738: [Sema][SVE] Reject by-copy capture of sizeless types.

The SVE ACLE doesn't allow fields to have sizeless type.  At the moment
clang accepts things like:

  struct s { __SVInt8_t x; } y;

but trying to code-generate it leads to LLVM asserts like:

  llvm/include/llvm/Support/TypeSize.h:126: uint64_t llvm::TypeSize::getFixedSize() const: Assertion `!IsScalable && "Request for a fixed size on a scalable object"' failed.

This patch adds an associated clang diagnostic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75737

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaLambda.cpp
  clang/test/Sema/sizeless-1.c
  clang/test/SemaCXX/sizeless-1.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75737.248700.patch
Type: text/x-patch
Size: 6584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200306/4496149b/attachment-0001.bin>


More information about the cfe-commits mailing list